data
Explore posts from serversimport.meta.glob no longer typed properly
After regenerating the lockfile of my project, my
import.meta.glob
call is now no longer receiving the proper vite-client types.
However they are in the nuxt.d.ts file. Has anyone else run into this?
Error: Property 'glob' does not exist on type 'ImportMeta'.ts-plugin(2339)
6 replies
CDCloudflare Developers
•Created by data on 8/26/2024 in #pages-help
Nitro build hangs after Nuxt 3.13 upgrade
We use Nuxt (therefore nitro), something in the recent 3.13 update broke our build.
Now it gets stuck, seemingly at the last stage before it prints "Finished"...
It gets stuck here and then the build times out after 20 minutes.
While in previous versions it would log this after:
Apparently this pr changed the structure and functions invoked on compilation finished hook
https://github.com/unjs/nitro/pull/2446
But... it also hangs when using the 2.10 nightly version 😦
1 replies
Cloudflare build hangs after upgrading to 3.13
We use Cloudflare Pages
cloudflare_pages
to deploy our app, it was working fine until the last update.
Now it gets stuck, seemingly at the last stage before it prints "Finished"...
It gets stuck here and then the build times out after 20 minutes.
While in previous verions it would log this after:
Has anyone had this issue?
EDIT: a little bit of digging in the nitro prs and source code
apparently this pr changed the structure and functions invoked on compilation finished hook
https://github.com/unjs/nitro/pull/2446
tested, it also hangs on 2.10 nightly1 replies
[OPEN] Working example of access/refresh token auth?
I didn't think this would be so complicated when I first started reading into Nuxt but after 4 different rewrite attempts I'm now a bit confused on whether it even makes sense.
Does anyone have any resources or examples of an authentication flow where users are given an access token and refresh token? The features I'm looking for are:
- Token rotation on expiration
- Token invalidation
- Server api guards (h3 layer)
- Route guards (nuxt layer) & composables
Because I want to load user data of private routes on the server, i need to always check if an access token is expired on each request... this means, that token rotation and expiration checking can be left entirely up to the server and the client no longer needs to worry about refreshing.
This flow is very strange to me and non-standard from what i've been able to read, but I thought maybe this is what SSR-first apps need...
Right now I have a working implementation that does all of the above (except route guards/composables), the server checks and rotates tokens on each request and then forwards the set-cookie header to nuxt, which uses
appendResponseHeader
and useRequestHeaders(['cookie'])
in a custom fetch wrapper to forward cookies properly.
However this does not work when user presses the back button, I get a weird node error, but in general I am very unhappy with this solution it feels hacky. Maybe token refresh is just not the move for an SSR environment? Would love to hear what you think, this is a major roadblock for me.
I have also looked into Auth.js and sidebase-auth but they seem overkill for the simplicity I want and they seem to have the same weird edge cases.3 replies