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.

ReferenceError: ResizeObserver is not defined

See original GitHub issue

ResizeObserver is not available in server-side rendering. Since the last version, the polyfill has been removed and therefore it’s not possible to server-side render components that has nivo.

ReferenceError: ResizeObserver is not defined
    at /Users/yagiz/Developer/iftrue/web/node_modules/@nivo/core/dist/nivo-core.cjs.js:1:12062
    at useReducer (/Users/yagiz/Developer/iftrue/web/node_modules/react-dom/cjs/react-dom-server.node.development.js:1537:57)
    at Object.useState (/Users/yagiz/Developer/iftrue/web/node_modules/react-dom/cjs/react-dom-server.node.development.js:1475:10)
    at Object.useState (/Users/yagiz/Developer/iftrue/web/node_modules/react/cjs/react.development.js:1508:21)
    at je (/Users/yagiz/Developer/iftrue/web/node_modules/@nivo/core/dist/nivo-core.cjs.js:1:12041)
    at Ee (/Users/yagiz/Developer/iftrue/web/node_modules/@nivo/core/dist/nivo-core.cjs.js:1:14782)
    at processChild (/Users/yagiz/Developer/iftrue/web/node_modules/react-dom/cjs/react-dom-server.node.development.js:3353:14)
    at resolve (/Users/yagiz/Developer/iftrue/web/node_modules/react-dom/cjs/react-dom-server.node.development.js:3270:5)
    at ReactDOMServerRenderer.render (/Users/yagiz/Developer/iftrue/web/node_modules/react-dom/cjs/react-dom-server.node.development.js:3753:22)
    at ReactDOMServerRenderer.read (/Users/yagiz/Developer/iftrue/web/node_modules/react-dom/cjs/react-dom-server.node.development.js:3690:29)

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:10
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

17reactions
plouccommented, Jan 26, 2022

@mdirshaddev yes it does, as the polyfill was installed by default 😃 please see my first comment, the fix is going to be available in the next release, although, I don’t have a date yet.

2reactions
citypaulcommented, Apr 18, 2022

@plouc When will the next release be available? I would appreciate it if it can be released ASAP. I couldn’t find the workaround without not using SSR, which isn’t the solution I want.

I found a temporary workaround for this was just locking down the versions of nivo to the previous release. I’ve created a new issue for this to remind the maintainers that this is still an issue here: https://github.com/plouc/nivo/issues/1975

Read more comments on GitHub >

github_iconTop Results From Across the Web

ReferenceError: ResizeObserver is not defined - Stack Overflow
I am writing tests using Jest for component which used chart.js to create a line chart. I am getting below error when I...
Read more >
"ResizeObserver is not defined" error when running Jest #40
Hello Using useResizeObserver crashes my app's tests. Jest uses JSDom, which apparently doesn't support the ResizeObserver API.
Read more >
ResizeObserver() - Web APIs | MDN
The ResizeObserver constructor creates a new ResizeObserver object, which can be used to report changes to the content or border box of an ......
Read more >
ResizeObserver is not defined with nivo and NextJS-Reactjs
[Solved]-ReferenceError: ResizeObserver is not defined with nivo and NextJS-Reactjs ... It's likely that code is being run on server side (SSR), and ...
Read more >
ResizeObserver JavaScript API - JavaScripture
Interactive API reference for the JavaScript ResizeObserver Object. ResizeObserver allows you to provide a function that is called asynchronously when the ...
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