vercel / next.js

The React Framework
https://nextjs.org
MIT License
127.19k stars 27.02k forks source link

Error: NEXT_DYNAMIC_NO_SSR_CODE #51756

Open deadcoder0904 opened 1 year ago

deadcoder0904 commented 1 year ago

Verify canary release

Provide environment information

Operating System:
      Platform: darwin
      Arch: x64
      Version: Darwin Kernel Version 21.6.0: Mon Aug 22 20:17:10 PDT 2022; root:xnu-8020.140.49~2/RELEASE_X86_64
    Binaries:
      Node: 20.3.0
      npm: 9.6.7
      Yarn: 1.22.19
      pnpm: 8.6.3
    Relevant Packages:
      next: 13.4.8-canary.2
      eslint-config-next: 13.4.7
      react: 18.2.0
      react-dom: 18.2.0
      typescript: 5.1.3
    Next.js Config:
      output: N/A

Which area(s) of Next.js are affected? (leave empty if unsure)

No response

Link to the code that reproduces this issue or a replay of the bug

https://github.com/deadcoder0904/next-13-lucia-auth-drizzle-turso-sqlite-magic-link/tree/server-component-bug

To Reproduce

see the branch server-component-bug & run it.

Describe the Bug

i get an error stating:

Unhandled errors reported when running the application.

Error: NEXT_DYNAMIC_NO_SSR_CODE

Expected Behavior

application should run.

i get all kinds of weird bugs that you've already closed like Error: Unsupported Server Component type: undefined for no reason.

once i fix this, i'll post about others.

Which browser are you using? (if relevant)

Chrome

How are you deploying your application? (if relevant)

Vercel

deadcoder0904 commented 1 year ago

this was because of turbopack which is in beta.

i removed next dev --turbo from my package.json node script & it worked.

wty-gogo commented 1 year ago

I solved this problem in the same way, thanks

deadcoder0904 commented 1 year ago

haha, i should re-open it then bcz it's related to turbo.

jetaggart commented 1 year ago

We're seeing this on vercel builds not using turbopack. Are you all testing forcing turbopack by chance on vercel?

ghost commented 1 year ago

When using dynamic import im getting <template data - dgst = "NEXT_DYNAMIC_NO_SSR_CODE"> < /template>in source, why? do we need turbo pack?

jetaggart commented 1 year ago

FWIW, this has been resolved for us on the latest canary.

yaxiaoliu commented 1 year ago

When using dynamic import im getting <template data - dgst = "NEXT_DYNAMIC_NO_SSR_CODE"> < /template>in source, why? do we need turbo pack?

In my case, <template data - dgst = "NEXT_DYNAMIC_NO_SSR_CODE" data-stck="xxxxxxxxxxxxxxx"> < /template>in source

https://github.com/vercel/next.js/issues/55373

Can anyone help me take a look?

theghostyced commented 10 months ago

@yaxiaoliu did you solve the issue?? I seem to be facing something similar as well currently

aakashsharma7 commented 1 month ago

this was because of turbopack which is in beta.

i removed next dev --turbo from my package.json node script & it worked.

thank you for this, it works