question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot read properties of undefined (reading 'csp')

See original GitHub issue

Steps to reproduce

When I start the next app then 1st it will work perfectly when I reload the browser it will respond to the ‘TypeError: Cannot read properties of undefined (reading ‘csp’)’ and the application is down. I run next app as SSR.

TypeError: Cannot read properties of undefined (reading 'csp')
    at Object.Wave._this.renderWave [as children] (C:\Users\Arnob\stupid_arnob\Paketler\Moversbd\moversbd-frontend\node_modules\antd\lib\_util\wave.js:177:22)
    at a.b.render (C:\Users\Arnob\stupid_arnob\Paketler\Moversbd\moversbd-frontend\node_modules\react-dom\cjs\react-dom-server.node.production.min.js:44:213)
    at a.b.read (C:\Users\Arnob\stupid_arnob\Paketler\Moversbd\moversbd-frontend\node_modules\react-dom\cjs\react-dom-server.node.production.min.js:41:83)
    at Object.exports.renderToString (C:\Users\Arnob\stupid_arnob\Paketler\Moversbd\moversbd-frontend\node_modules\react-dom\cjs\react-dom-server.node.production.min.js:52:138)
    at Object.renderPage (C:\Users\Arnob\stupid_arnob\Paketler\Moversbd\moversbd-frontend\node_modules\next\dist\server\render.js:804:45)
    at Object.defaultGetInitialProps (C:\Users\Arnob\stupid_arnob\Paketler\Moversbd\moversbd-frontend\node_modules\next\dist\server\render.js:391:51)
    at Function.getInitialProps (C:\Users\Arnob\stupid_arnob\Paketler\Moversbd\moversbd-frontend\.next\server\pages\_document.js:203:20)
    at Object.loadGetInitialProps (C:\Users\Arnob\stupid_arnob\Paketler\Moversbd\moversbd-frontend\node_modules\next\dist\shared\lib\utils.js:65:29)
    at documentInitialProps (C:\Users\Arnob\stupid_arnob\Paketler\Moversbd\moversbd-frontend\node_modules\next\dist\server\render.js:817:48)
    at renderDocument (C:\Users\Arnob\stupid_arnob\Paketler\Moversbd\moversbd-frontend\node_modules\next\dist\server\render.js:841:55)

What is expected?

The SSR runs the application without any error.

What is actually happening?

When I reload the browser the next app render again then it came back to Server 500 Error. And the terminal I see the TypeError: Cannot read properties of undefined (reading ‘csp’) at Object.Wave._this.renderWave [as children] (C:\Users\Arnob\stupid_arnob\Paketler\Moversbd\moversbd-frontend\node_modules\antd\lib_util\wave.js:177:22) at a.b.render (C:\Users\Arnob\stupid_arnob\Paketler\Moversbd\moversbd-frontend\node_modules\react-dom\cjs\react-dom-server.node.production.min.js:44:213) at a.b.read (C:\Users\Arnob\stupid_arnob\Paketler\Moversbd\moversbd-frontend\node_modules\react-dom\cjs\react-dom-server.node.production.min.js:41:83) at Object.exports.renderToString (C:\Users\Arnob\stupid_arnob\Paketler\Moversbd\moversbd-frontend\node_modules\react-dom\cjs\react-dom-server.node.production.min.js:52:138) at Object.renderPage (C:\Users\Arnob\stupid_arnob\Paketler\Moversbd\moversbd-frontend\node_modules\next\dist\server\render.js:804:45) at Object.defaultGetInitialProps (C:\Users\Arnob\stupid_arnob\Paketler\Moversbd\moversbd-frontend\node_modules\next\dist\server\render.js:391:51) at Function.getInitialProps (C:\Users\Arnob\stupid_arnob\Paketler\Moversbd\moversbd-frontend.next\server\pages_document.js:203:20) at Object.loadGetInitialProps (C:\Users\Arnob\stupid_arnob\Paketler\Moversbd\moversbd-frontend\node_modules\next\dist\shared\lib\utils.js:65:29) at documentInitialProps (C:\Users\Arnob\stupid_arnob\Paketler\Moversbd\moversbd-frontend\node_modules\next\dist\server\render.js:817:48) at renderDocument (C:\Users\Arnob\stupid_arnob\Paketler\Moversbd\moversbd-frontend\node_modules\next\dist\server\render.js:841:55)

Environment Info
antd 4.21.3
React Next v12.1.6
System Window 11
Browser Chrome

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:4
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
Endevircommented, Jul 9, 2022

Hi everybody! I’ve also run into this issue, unfortunately it’s difficult to reproduce, but update react&react-dom to 18.2.0 helped for me.

My primary dependencies versions currently are:

    "next": "12.2.0",
    "next-transpile-modules": "^9.0.0",
    "react": "18.2.0",
    "react-dom": "18.2.0",
    "antd": "~4.21.5",
    "antd-mobile": "^5.16.1",
0reactions
IRediTOTOcommented, Jul 12, 2022

I get this error too

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot read properties of undefined (reading 'dataResponse ...
Typically, the error TypeError: Cannot read properties of undefined refers to trying to reference a property within a property within an ...
Read more >
Cannot read property 'csp_nonce' of undefined (Soy parser ...
This error occurs when a property is read or a function is called on an undefined variable. Undefined means that a variable has...
Read more >
cannot read properties of undefined (reading 'configurations ...
TypeError : Cannot read properties of undefined (reading 'map') Solution: The problem arises because we're attempting to map an undefined object (products) into ......
Read more >
DNS pool cannot be open with "Cannot read properties of ...
Support Solution. 2. DNS configuration including DNS pools discovered. Issue is caused by an unsupported custom monitor attached to the pool.
Read more >
Can't Access the CS50 Codespaces - Reddit
... the desktop version, it gives me the error message: "Connect to Codespace: Cannot read properties of undefined (reading 'sessionPath').
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found