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

404 renders __NEXT_DATA__ as string to DOM when using RSC after deploy, locally no response #32515

Closed
KlotzJesse opened this issue Dec 14, 2021 · 3 comments · Fixed by #33399
Closed
Labels
bug Issue was opened via the bug report template.

Comments

@KlotzJesse
Copy link

KlotzJesse commented Dec 14, 2021

What version of Next.js are you using?

12.0.8-canary.5 up to 12.0.8-canary.7

What version of Node.js are you using?

local: 14.8.1 // vercel: 14

What browser are you using?

Chrome

What operating system are you using?

macOS

How are you deploying your application?

Vercel

Describe the Bug

When updating to newest canaries, starting by 12.0.8-canary.5, using serverComponents: true and concurrentFeatures: true the 404 page (default and custom) won't respond without error to the console.
When being deployed, the 404 renders, but with the NEXT_DATA json rendered as string to the dom.

When deployed, it's looking like:
image

on reproducible url: https://next-rsc-demo-e3pu88wfg-klotzjesse.vercel.app/thisdoesnotexist

and console:
image

Expected Behavior

Render in development.

And after deployment, without having NEXT_DATA as string in the dom.

To Reproduce

Update to canary 12.0.8-canary.5 up to .7
Activate in next.config.js

module.exports = {
  experimental: {
    reactRoot: true,
    concurrentFeatures: true,
    serverComponents: true,
  },
}

Deploy to Vercel / run yarn dev
Run into failure

Minimal Reproduction:
Failure (server): https://next-rsc-demo-e3pu88wfg-klotzjesse.vercel.app/rsc
Running (client): https://next-rsc-demo-e3pu88wfg-klotzjesse.vercel.app

Repo: https://github.com/KlotzJesse/next-rsc-demo/tree/rsc-fails-render-with-client-error

@KlotzJesse KlotzJesse added the bug Issue was opened via the bug report template. label Dec 14, 2021
@KlotzJesse
Copy link
Author

This render issues could somehow be related to #32514, i think? vice-versa

@KlotzJesse
Copy link
Author

KlotzJesse commented Dec 20, 2021

Still occuring on v12.0.8-canary.10:

Vercel reproduction deployment with v12.0.8-canary.10:
https://next-rsc-demo-klotzjesse.vercel.app/asd

I investigated:
Default error page won't render in dev (loading loop), but on production.

Custom 404 will render in dev env, showing a different String.
image

So I also found out some new errors in the local, dev env browser console:

image
image

After deployment it will show the same string as in the reproduction.

@kodiakhq kodiakhq bot closed this as completed in #33399 Jan 17, 2022
kodiakhq bot pushed a commit that referenced this issue Jan 17, 2022
## Bug

Fixes: #32515

Previously, we render the `suffix` after consuming 1st chunk, instead we should render it after stream finished

- [x] Related issues linked using `fixes #number`
- [x] Integration tests added
- [x] Errors have helpful link attached, see `contributing.md`
natew pushed a commit to natew/next.js that referenced this issue Feb 16, 2022
## Bug

Fixes: vercel#32515

Previously, we render the `suffix` after consuming 1st chunk, instead we should render it after stream finished

- [x] Related issues linked using `fixes #number`
- [x] Integration tests added
- [x] Errors have helpful link attached, see `contributing.md`
@balazsorban44
Copy link
Member

This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@vercel vercel locked as resolved and limited conversation to collaborators Feb 17, 2022
nevilm-lt pushed a commit to nevilm-lt/next.js that referenced this issue Apr 22, 2022
## Bug

Fixes: vercel#32515

Previously, we render the `suffix` after consuming 1st chunk, instead we should render it after stream finished

- [x] Related issues linked using `fixes #number`
- [x] Integration tests added
- [x] Errors have helpful link attached, see `contributing.md`
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue was opened via the bug report template.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants