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) in node_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
- Goes to https://next-safe-middleware.vercel.app/
- Open developer console
- Press F5(Refresh) 3 times (It not limited to refresh 3 times, sometime after consecutive loading we'll get this error but refresh 3 times is the most reliable way to reproduce this.
- You will get
TypeError: Cannot read properties of null (reading 'textContent') error
- From here javascript won't work
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.jsMay 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')error