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

Wasteful .json file requested while middleware is enabled causes WSOD #40611

Closed
1 task done
mlstubblefield opened this issue Sep 16, 2022 · 6 comments
Closed
1 task done
Labels
bug Issue was opened via the bug report template.

Comments

@mlstubblefield
Copy link

mlstubblefield commented Sep 16, 2022

Verify canary release

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

Provide environment information

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

What browser are you using? (if relevant)

not relevant

How are you deploying your application? (if relevant)

vercel

Describe the Bug

This is somewhat related to this issue #40583

But if the application is deployed, the .json files will 404 in the event of navigation or use of the back button.
If enough of them 404, you'll get a white screen of death.

When we see this happen to our customers (via log rocket), we see this error message

const error = new Error(`Failed to load static props`)

Expected Behavior

No white screen of death, but preferably if the wasteful .json files can go away that'd be nice too (which relates back to my first report).

Link to reproduction

https://next-json-repro.vercel.app/ and https://github.com/mlstubblefield/next-json-repro

To Reproduce

To simulate a deployment you have to be a little clever, but using Chrome developer tools you can block the two files that would normally be requested.

  1. Browse to https://next-json-repro.vercel.app/
  2. Open chrome dev tools
  3. Block the "first" .json file https://next-json-repro.vercel.app/_next/data/{buildId}/index.json?something=1
  4. Refresh the page
  5. Block the "second" .json file https://next-json-repro.vercel.app/_next/data/{buildId}/1.json?something=1
  6. Refresh
  7. Get WSOD

image

This is happening us when we deploy our app to real customers. They're getting WSODs when the utilize the back button or return on a somewhat stale session.This is happening us when we deploy our app to real customers. They're getting WSODs when the utilize the back button or return on a somewhat stale session.

@mlstubblefield mlstubblefield added the bug Issue was opened via the bug report template. label Sep 16, 2022
@voronianski
Copy link

we're observing the same issue after upgrading to v12.3 on our app

@ijjk
Copy link
Member

ijjk commented Oct 11, 2022

Hi, this should be resolved by #41243 which eliminated the additional _next/data request during query hydration which is available in v12.3.2-canary.24 of Next.js. Please update and give it a try!

@mlstubblefield
Copy link
Author

I'm evaluating this right now.

@mlstubblefield
Copy link
Author

I've verified that I do not see any wasteful .json requests anymore! Thanks!

@ijjk
Copy link
Member

ijjk commented Oct 13, 2022

Awesome, glad to here that resolved this, will close this out then!

@ijjk ijjk closed this as completed Oct 13, 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 Nov 13, 2022
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

No branches or pull requests

3 participants