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

Fix Cannot read properties of null (reading 'textContent') when __NEXT_DATA__ element is missing #75512

Open
wants to merge 1 commit into
base: canary
Choose a base branch
from

Conversation

remorses
Copy link
Contributor

When using getServerSideProps and streaming it can happen that the Next.js framework script runs before the __NEXT_DATA__ script, if that happens the page becomes unresponsive and an error is thrown: Cannot read properties of null (reading 'textContent')

Fix #53423
Fix #41299
Fix #47377
Fix nibtime/next-safe-middleware#83

This PR waits for __NEXT_DATA__ to be available if it's missing, it does not add any latency in case NEXT_DATA is present which should be true for most cases

@remorses remorses changed the title Fix missing __NEXT_DATA__ element Fix Cannot read properties of null (reading 'textContent') when __NEXT_DATA__ element is missing Jan 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants