blitz: A new app generated by `blitz new` causes `Error: DYNAMIC_SERVER_USAGE`
What is the problem?
A new app generated by blitz new (Blitz version: 2.0.0-beta.24) causes Error: DYNAMIC_SERVER_USAGE.
Reproduction repo with steps: https://github.com/exKAZUu/blitz-new-issue
Paste all your error logs here:
Uncaught Error: DYNAMIC_SERVER_USAGE
at updateDehydratedSuspenseComponent (react-dom.development.js?ac89:20662:1)
at updateSuspenseComponent (react-dom.development.js?ac89:20362:1)
at beginWork (react-dom.development.js?ac89:21624:1)
at beginWork$1 (react-dom.development.js?ac89:27426:1)
at performUnitOfWork (react-dom.development.js?ac89:26557:1)
at workLoopSync (react-dom.development.js?ac89:26466:1)
at renderRootSync (react-dom.development.js?ac89:26434:1)
at performConcurrentWorkOnRoot (react-dom.development.js?ac89:25738:1)
at workLoop (scheduler.development.js?c964:266:1)
at flushWork (scheduler.development.js?c964:239:1)
at MessagePort.performWorkUntilDeadline (scheduler.development.js?c964:533:1)
Paste all relevant code snippets here:
Nothing due to a completely new app.
What are detailed steps to reproduce this?
blitz new blitz-new-issue- Select the following items
✔ Pick a new project's language › TypeScript ✔ Pick your new app template › Full - includes DB and auth (Recommended) ✔ Install dependencies? › yarn ✔ Pick a form library (you can switch to something else later if you want) › React Final Form (recommended) cd blitz-new-issueyarn blitz dev- The following error is shown

Run blitz -v and paste the output here:
$ yarn blitz -v
yarn run v1.22.19
warning ../package.json: No license field
$ /Users/exkazuu/temp/blitz-new-issue/node_modules/.bin/blitz -v
Blitz version: 2.0.0-beta.24 (local)
macOS Ventura | darwin-arm64 | Node: v19.8.1
Package manager: npm
System:
OS: macOS 13.3
CPU: (8) arm64 Apple M1
Memory: 305.78 MB / 16.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 19.8.1 - /var/folders/9p/8yqjg80d1n9dpmz33_v4hgj80000gn/T/yarn--1680495709340-0.42917398572189014/node
Yarn: 1.22.19 - /var/folders/9p/8yqjg80d1n9dpmz33_v4hgj80000gn/T/yarn--1680495709340-0.42917398572189014/yarn
npm: 9.5.1 - ~/.asdf/shims/npm
npmPackages:
@blitzjs/auth: 2.0.0-beta.24 => 2.0.0-beta.24
@blitzjs/next: 2.0.0-beta.24 => 2.0.0-beta.24
@blitzjs/rpc: 2.0.0-beta.24 => 2.0.0-beta.24
@prisma/client: 4.6.1 => 4.6.1
blitz: 2.0.0-beta.24 => 2.0.0-beta.24
next: 13.2 => 13.2.4
prisma: 4.6.1 => 4.6.1
react: 18.2.0 => 18.2.0
react-dom: 18.2.0 => 18.2.0
typescript: ^4.8.4 => 4.9.5
Please include below any other applicable logs and screenshots that show your problem:
The section of the reproduction steps includes a screenshot.
About this issue
- Original URL
- State: closed
- Created a year ago
- Reactions: 7
- Comments: 33 (14 by maintainers)
Unfortunately I am still getting the same error with 2.0.0-beta.27. 😢
I have
blitzinstalled globally on linux/windows usingnpm.@flybayer I did just
blitz new my-blitz-appandblitz devfrom the tutorial. It looks it attempts to apply some patch but it is not working.blitz buildorblitz codegenalso report patch being applied also with no success.Same error at my Windows machine as well. I chose all default options during project generation: Typescript, Full, npm, React Final Form. Minimal version seems to work fine, though.
The same for me a fresh install of beta 2.0.0-beta.27 and I still get the same error
For those experiencing this issue, this worked for me:
ctrl-crm -rf node_modulesrm -rf .nextpackage.jsonand change"next": "13.2"to"next": "13.2.4"👆npm iblitz devThis ticket should be reopened because the problem still exists with blitz beta 27 when running the commands below.
Following @bravo-kernel hint at updating next to 13.4.4, those steps do work for me…
The issue is real. Solved for me against next
13.4.4as described below:node_modulespackage-lock.json.nextnpm installblitz devProbably unrelated but I just checked the commit that fixed the dev issue for me and noticed that I also bumped all next packages to
13.4.4. Basically as the first step, before running the other five described above.Same here with
"next": "^13.3.1",13.1 works for sure.
If you need 13.2 you can temporarily disable suspense inside useQuery
export const useCurrentUser = () => { const [user] = useQuery(getCurrentUser, null, { suspense: false }) return user }If you have more queries, create a global query client and set suspense as default to false.
I don’t understand why this error appears, may be someone from the core team could explain to us.