blitz-js / blitz

⚡️ The Missing Fullstack Toolkit for Next.js
https://Blitzjs.com
MIT License
13.7k stars 800 forks source link

Next 15 error when using `getBlitzContext` #4388

Open stijnvanderlaan opened 1 week ago

stijnvanderlaan commented 1 week ago

What is the problem?

I get an error

Paste all your error logs here:

Route "/" used `...headers()` or similar iteration. `headers()` should be awaited before using its value. Learn more: https://nextjs.org/docs/messages/sync-dynamic-apis

Run blitz -v and paste the output here:

Blitz version: 2.0.0-beta.30 (global)
Blitz version: 2.1.2 (local)
macOS | darwin-arm64 | Node: v20.11.0

 Package manager: npm

  System:
    OS: macOS 15.1
    CPU: (10) arm64 Apple M1 Pro
    Memory: 98.75 MB / 32.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.11.0 - ~/.nvm/versions/node/v20.11.0/bin/node
    Yarn: 1.22.18 - ~/.nvm/versions/node/v20.11.0/bin/yarn
    npm: 10.2.4 - ~/.nvm/versions/node/v20.11.0/bin/npm
  npmPackages:
    @blitzjs/auth: Not Found
    @blitzjs/next: Not Found
    @blitzjs/rpc: Not Found
    @prisma/client: Not Found
    blitz: Not Found
    next: Not Found
    prisma: Not Found
    react: Not Found
    react-dom: Not Found
    typescript: 5.3.3 => 5.3.3 

➜  app git:(main) ✗ blitz - v
Loaded env from /Users/stijnvanderlaan/Workspace/demonsters/stringtale/stringtale-mono/apps/app/.env.local
Error: Cannot find module '-'
Require stack:
- /Users/stijnvanderlaan/Workspace/demonsters/stringtale/stringtale-mono/apps/app/noop.js
➜  app git:(main) ✗ blitz -v 
Blitz version: 2.0.0-beta.30 (global)
Blitz version: 2.1.2 (local)
macOS | darwin-arm64 | Node: v20.11.0

 Package manager: npm

  System:
    OS: macOS 15.1
    CPU: (10) arm64 Apple M1 Pro
    Memory: 300.11 MB / 32.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.11.0 - ~/.nvm/versions/node/v20.11.0/bin/node
    Yarn: 1.22.18 - ~/.nvm/versions/node/v20.11.0/bin/yarn
    npm: 10.2.4 - ~/.nvm/versions/node/v20.11.0/bin/npm
  npmPackages:
    @blitzjs/auth: Not Found
    @blitzjs/next: Not Found
    @blitzjs/rpc: Not Found
    @prisma/client: Not Found
    blitz: Not Found
    next: Not Found
    prisma: Not Found
    react: Not Found
    react-dom: Not Found
    typescript: 5.3.3 => 5.3.3 

Please include below any other applicable logs and screenshots that show your problem:

No response

siddhsuresh commented 1 week ago

will be fixed in https://github.com/blitz-js/blitz/pull/4387

stijnvanderlaan commented 1 week ago

I added a suggestion to ensure compatibility with older versions. Hopefully, this helps move the update forward.

stijnvanderlaan commented 11 hours ago

Any update on this?