next.js
next.js copied to clipboard
Dynamic = 'error' throws exception on very simple static page
Verify canary release
- [X] I verified that the issue exists in the latest Next.js canary release
Provide environment information
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 22.1.0: Sun Oct 9 20:15:09 PDT 2022; root:xnu-8792.41.9~2/RELEASE_ARM64_T6000
Binaries:
Node: 17.8.0
npm: 8.19.2
Yarn: 1.22.19
pnpm: 7.16.1
Relevant packages:
next: 13.0.4-canary.5
eslint-config-next: 13.0.3
react: 18.2.0
react-dom: 18.2.0
What browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
No response
Describe the Bug
I have a freshly installed next@canary build (yarn create next-app --experimental-app).
I created a simple page with the following code (located in app/test/page.tsx):
export const dynamic = "error"
export default function Page() {
return <div>Nice!</div>
}
When running yarn build, I get an exception:
Error occurred prerendering page "/test". Read more: https://nextjs.org/docs/messages/prerender-error
Error: Page with dynamic = "error" encountered dynamic data method /test.
at /Users/colinarms/src/nextplayground/test/node_modules/next/dist/export/worker.js:192:31
at async Span.traceAsyncFn (/Users/colinarms/src/nextplayground/test/node_modules/next/dist/trace/trace.js:79:20)
This is a very simple static page with no dynamic fetches, so dynamic = 'error' shouldn't throw any exceptions.
Expected Behavior
The static page should get generated with no issue.
Link to reproduction - Issues with a link to complete (but minimal) reproduction code will be addressed faster
https://github.com/seeARMS/nextjs-dynamic-repro
To Reproduce
- Git clone repo
- Run
yarn build - Exception occurs and build fails