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.

Gatsby build issue - 'regeneratorRuntime' is not defined

See original GitHub issue

The project was working fine before using Content-management API. It’s working fine over gatsby develop but the builds fails. The error refers to ‘regeneratorRuntime’ being undefined and I tried couple of it’s solutions posted in the community it didn’t solved my issue. Do share your views if you have faced anything like this or any thing that could help me out

Error:

success Building production JavaScript and CSS bundles - 35.999s
failed Building static HTML for pages - 10.501s
error Building static HTML failed

  35 | };
  36 | export var update = /*#__PURE__*/function () {
> 37 |   var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(http, params, rawData, headers) {
     | ^
  38 |     var _rawData$sys$version;
  39 | 
  40 |     var data;


  WebpackError: ReferenceError: regeneratorRuntime is not defined

  - app-definition.js:37 
    node_modules/contentful-management/dist/es-modules/plain/endpoints/app-definition.js:37:1

  - app-definition.js:64 
    node_modules/contentful-management/dist/es-modules/plain/endpoints/app-definition.js:64:2

  - index.js:1 
    node_modules/contentful-management/dist/es-modules/plain/endpoints/index.js:1:1

  - api-key.js:1 
    node_modules/contentful-management/dist/es-modules/entities/api-key.js:1:1

  - index.js:1 
    node_modules/contentful-management/dist/es-modules/entities/index.js:1:1

  - create-contentful-api.js:1 
    node_modules/contentful-management/dist/es-modules/create-contentful-api.js:1:1

  - contentful-management.js:1 
    node_modules/contentful-management/dist/es-modules/contentful-management.js:1:1

  - index.jsx:1 
    src/containers/suggestArticle/articleForm/index.jsx:1:1

  - index.jsx:1 
    src/containers/suggestArticle/index.jsx:1:1

Dependencies:

"dependencies": {
    "@contentful/rich-text-react-renderer": "^14.1.2",
    "@contentful/rich-text-types": "^14.1.2",
    "contentful-management": "^7.5.0",
    "formik": "^2.2.6",
    "gatsby": "^2.25.3",
    "gatsby-background-image": "^1.3.1",
    "gatsby-image": "^2.4.21",
    "gatsby-plugin-manifest": "^2.5.2",
    "gatsby-plugin-offline": "^3.3.3",
    "gatsby-plugin-postcss": "^3.1.0",
    "gatsby-plugin-react-helmet": "^3.3.14",
    "gatsby-plugin-sass": "^2.5.1",
    "gatsby-plugin-sharp": "^2.7.1",
    "gatsby-source-contentful": "^4.2.1",
    "gatsby-source-filesystem": "^2.4.2",
    "gatsby-transformer-sharp": "^2.5.21",
    "netlify-cli": "^2.69.9",
    "node-sass": "^4.14.1",
    "open-graph-scraper": "^4.7.1",
    "prop-types": "^15.7.2",
    "react": "^16.12.0",
    "react-dom": "^16.12.0",
    "react-helmet": "^6.1.0",
    "react-id-swiper": "^4.0.0",
    "react-input-range": "^1.3.0",
    "swiper": "^6.3.5",
    "yup": "^0.32.8"
  },
  "devDependencies": {
    "dotenv": "^8.2.0",
    "env-cmd": "^10.1.0",
    "prettier": "2.1.2",
    "tailwindcss": "^1.9.6"
  },

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
janro1commented, May 27, 2021

Is there a specific reason why the webpack config builds for node >= 6? Nobody should use node 6 anymore, so why do new releases still support this ancient technology? If webpack would build for node >= 8, babel would not try to polyfill async/await

2reactions
jtonneyckcommented, Mar 13, 2021

Same issue here. Zopa’s fix works.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to fix regeneratorRuntime is not defined?
I have ran into a problem, the error is regeneratorRuntime is not defined while working with React and Parcel bundler.
Read more >
regeneratorRuntime is not defined in react 17, webpack 5 ...
Having this error Uncaught ReferenceError: regeneratorRuntime is not defined when trying to make a api call using superagent.
Read more >
regeneratorruntime is not defined - code-comments
Building my app went fine, but when I went to use it, it crashed immediately. Auth0Context.js:145 Uncaught ReferenceError: regeneratorRuntime is ...
Read more >
Uncaught ReferenceError: regeneratorRuntime is not defined ...
Ran into this problem (using Babel v7) and even after following the advice and installing relevant packages, I was still unable to get...
Read more >
Bundling and Building with Parcel - Beginner JavaScript
We have run into this issue before. uncaught reference error - regeneratorRuntime is not defined. handlers.js:7 Uncaught ReferenceError: regeneratorRuntime ...
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