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.

Getting an Error with SSR after most recent update

See original GitHub issue

After the most recent update I’m getting this error:

regeneratorRuntime is not defined
ReferenceError: regeneratorRuntime is not defined
    at /sandbox/node_modules/@react-spring/core/index.cjs.js:635:5
    at /sandbox/node_modules/@react-spring/core/index.cjs.js:687:4
    at Object.<anonymous> (/sandbox/node_modules/@react-spring/core/index.cjs.js:1203:2)
    at Module._compile (internal/modules/cjs/loader.js:776:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Module.require (internal/modules/cjs/loader.js:690:17)
    at require (internal/modules/cjs/helpers.js:25:18)
    at Object.<anonymous> (/sandbox/node_modules/@react-spring/web/index.cjs.js:8:12)
    at Module._compile (internal/modules/cjs/loader.js:776:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)

Here is a fresh codesandbox and it happens with Nextjs in just a vanilla example. https://codesandbox.io/embed/hello-world-49rmf

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

5reactions
jorgenhocommented, Sep 30, 2019

I found a workaround for this issue:

add @babel/plugin-transform-runtime as a dev dependency, and import it in your _app.js file:

import 'regenerator-runtime/runtime';

https://babeljs.io/docs/en/babel-polyfill

4reactions
harshzalavadiyacommented, Sep 30, 2019

I found a workaround for this issue:

add @babel/plugin-transform-runtime as a dev dependency, and import it in your _app.js file:

import 'regenerator-runtime/runtime';

https://babeljs.io/docs/en/babel-polyfill

Can confirm works! I guess issue is coming from react-spring using 9.x if you lock version at react-spring@8.0.27 also worked for me

"resolutions": {
  "react-spring": "8.0.27"
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

Enable Angular 13: SSR error with Webpack - Stack Overflow
I was wondering if this have anything to do with webpack and I found that there has been some questions that has been...
Read more >
Create a custom error component in Next.js (SSR & CSR)
First, create a fresh Next.js project by running npx create-next-app@latest custom-error-component · stop npm in your terminal and run npm run ...
Read more >
Debugging and fixing hydration issues - somewhat abstract
Spotting hydration errors and fixing them can prevent serious user-facing performance issues, and since we do not get a signal during ...
Read more >
react-hydration-error - Next.js
When css-in-js libraries are not set up for pre-rendering (SSR/SSG) it will often lead to a hydration mismatch. In general this means the...
Read more >
SSR 6.0 Release Notes | SSN Docs
If you do not see an issue listed below, it may have been resolved in another recently released version. A link to 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