-
Notifications
You must be signed in to change notification settings - Fork 20
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
TypeError: Cannot read properties of null (reading 'textContent') #83
Comments
I am having the same problem with my next app but only on Edge. Due to this failure its failing to run any useEffects on any components so the whole site fails. I remove CSP in the _document it goes away too. Any one got any ideas on this one yet? |
I created a simple project to replicate this issue you can find here: It seems you need CSP plus something significant to render so I've added a bunch of SVG icons to home page to replicate it. |
This issue seems to be Chromium-specific. It reproduces 90%+ of time when I emulate slow connection (50 kbps). Firefox works fine It's somehow related to the way scripts are being loaded |
Now I hit this issue. I can reproduce following procedure.
FYI, When I tired turn off React dev tool extension, this issue is gone in my environment. But some my colleague cannot reproduce this issue, I'm struggling... |
Did anyone find a fix for this? |
Description
Getting
TypeError: Cannot read properties of null (reading 'textContent')
error after consecutive reloading.This error originate from this code
JSON.parse(document.getElementById('__NEXT_DATA__').textContent)
innode_modules/next/dist/client/index.js
May be it's something to do with async await on _document file.
If I remove csp related from _document file it'll work just fine.
Screenshot
Step to reproduce
TypeError: Cannot read properties of null (reading 'textContent')
errorThe text was updated successfully, but these errors were encountered: