Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errro when using "export const dynamic = "error"; #43477

Closed
1 task done
sawa-ko opened this issue Nov 28, 2022 · 2 comments
Closed
1 task done

Errro when using "export const dynamic = "error"; #43477

sawa-ko opened this issue Nov 28, 2022 · 2 comments
Labels
area: app App directory (appDir: true)

Comments

@sawa-ko
Copy link

sawa-ko commented Nov 28, 2022

Details

Verify canary release

  • I verified that the issue exists in the latest Next.js canary release

Provide environment information

yarn run v1.22.19
$ E:\Proyectos\Forks\my-app\node_modules.bin\next info

Operating System:
  Platform: win32
  Arch: x64
  Version: Windows 10 Pro
Binaries:
  Node: 18.9.0
  npm: N/A
  Yarn: N/A
  pnpm: N/A
Relevant packages:
  next: 13.0.5
  eslint-config-next: 13.0.5
  react: 18.2.0
  react-dom: 18.2.0

warn - Latest canary version not detected, detected: "13.0.5", newest: "13.0.6-canary.1".
Please try the latest canary version (npm install next@canary) to confirm the issue still exists before creating a new issue.
Read more - https://nextjs.org/docs/messages/opening-an-issue

What browser are you using? (if relevant)

No response

How are you deploying your application? (if relevant)

next build

Describe the Bug

When a page is configured to have the dynamic option as error, at the moment of compiling the application the following error is obtained.

$ next build
warn  - You have enabled experimental feature (appDir) in next.config.js.
warn  - Experimental features are not covered by semver, and may cause unexpected or broken application behavior. Use at your own risk.
info  - Thank you for testing `appDir` please leave your feedback at https://nextjs.link/app-feedback

info  - Creating an optimized production build
info  - Compiled successfully
info  - Linting and checking validity of types
info  - Collecting page data
[    ] info  - Generating static pages (0/3)
Error occurred prerendering page "/". Read more: https://nextjs.org/docs/messages/prerender-error
Error: Page with dynamic = "error" encountered dynamic data method /.
    at E:\Proyectos\Forks\my-app\node_modules\next\dist\export\worker.js:192:31
    at async Span.traceAsyncFn (E:\Proyectos\Forks\my-app\node_modules\next\dist\trace\trace.js:79:20)
info  - Generating static pages (3/3)

> Build error occurred
Error: Export encountered errors on following paths:
        /page: /
    at E:\Proyectos\Forks\my-app\node_modules\next\dist\export\index.js:408:19
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Span.traceAsyncFn (E:\Proyectos\Forks\my-app\node_modules\next\dist\trace\trace.js:79:20)
    at async E:\Proyectos\Forks\my-app\node_modules\next\dist\build\index.js:1334:21
    at async Span.traceAsyncFn (E:\Proyectos\Forks\my-app\node_modules\next\dist\trace\trace.js:79:20)
    at async E:\Proyectos\Forks\my-app\node_modules\next\dist\build\index.js:1194:17
    at async Span.traceAsyncFn (E:\Proyectos\Forks\my-app\node_modules\next\dist\trace\trace.js:79:20)
    at async Object.build [as default] (E:\Proyectos\Forks\my-app\node_modules\next\dist\build\index.js:65:29)
// app/page.tsx
export const dynamic = "error";

export default function Page() {
  return null;
}

Expected Behavior

To be able to compile the application correctly.

Link to reproduction - Issues with a link to complete (but minimal) reproduction code will be addressed faster

https://github.com/kaname-png/my-app/tree/dynamic-option

To Reproduce

  1. Create a next app with v13
  2. Add export const dynamic = "error"; to page.tsx
  3. Run the command next build
  4. See error
@sawa-ko sawa-ko added the bug Issue was opened via the bug report template. label Nov 28, 2022
@sawa-ko sawa-ko changed the title Errro when using "export const dynamic = "error";` Errro when using "export const dynamic = "error"; Nov 28, 2022
@hanneslund hanneslund added area: app App directory (appDir: true) and removed bug Issue was opened via the bug report template. labels Nov 30, 2022
@hanneslund
Copy link
Contributor

Thanks for the report, this is fixed in v13.0.6-canary.2 by #43377.

@vercel vercel deleted a comment from github-actions bot Nov 30, 2022
@github-actions
Copy link
Contributor

This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: app App directory (appDir: true)
Projects
None yet
Development

No branches or pull requests

2 participants