Open ncasola opened 3 hours ago
Use of headers() in next 15 give a error: [ Server ] Error: Route "/private" usedheaders().get('X-FiefAuth-Access-Token-Info').headers()should be awaited before using its value. Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis
[ Server ] Error: Route "/private" used
.
should be awaited before using its value. Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis
Follow the integrate guide in https://docs.fief.dev/integrate/javascript/ssr/nextjs-app/
JavaScript environment: NextJs 15, pnpm, TS
Fief client version: npm @/fief latest
Fief Cloud or self-hosted: self-hosted
If self-hosted, Fief version: ghcr.io/fief-dev/fief:latest
Thank you for the report @ncasola 🙏
This is a breaking change introduced in Next.js 15... It's really hard to keep up with them, this is exhausting.
Describe the bug
Use of headers() in next 15 give a error:
[ Server ] Error: Route "/private" used
headers().get('X-FiefAuth-Access-Token-Info').
headers()should be awaited before using its value. Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis
To Reproduce
Follow the integrate guide in https://docs.fief.dev/integrate/javascript/ssr/nextjs-app/
Configuration
JavaScript environment: NextJs 15, pnpm, TS
Fief client version: npm @/fief latest
Fief Cloud or self-hosted: self-hosted
If self-hosted, Fief version: ghcr.io/fief-dev/fief:latest
Additional context