🐛[BUG] ReferenceError: self is not defined in Next.js
See original GitHub issueI apologize, but the template for the issue is in Chinese and I don’t understand it.
Basically, using SSR with Next.js, If I install the library and try to render a chart I get this error.
Steps to reproduce:
- Clone this
npm install
npm run dev
Version: ant-design-charts ^1.1.1
Thanks for any help 😀
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:9 (4 by maintainers)
Top Results From Across the Web
reactjs - Why am I getting ReferenceError: self is not defined ...
The error occurs because the library requires Web APIs to work, which are not available when Next.js pre-renders the page on the server-side ......
Read more >nextjs 12.2 middleware : ReferenceError: self is not defined
I am using a boilerplate with nextjs 12.2. I want to use the middleware so I added a middleware.ts in the page folder,...
Read more >self is not defined nextjs | The AI Search Engine You Control
I'm using filemanger in my Nextjs apps.it showing me ReferenceError: self is not defined. even though I disabled SSR on that page but...
Read more >[Solved]-Reference Error: self is not defined-Reactjs
self is likely referring to window which is not available on the server side...it's only available in a browser context. The navigator reference...
Read more >NextJS ReferenceError: self is not defined
Hi everyone,. I keep getting error every time I refresh the page that renders the map. I'm using the “@tomtom-international/web-sdk-maps” and “@ ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You can try to import from lib.
@robertosannazzaro By nextjs documentation, the actual solution for undefined
window/self
reference is as follows: