ReferenceError: regeneratorRuntime is not defined
See original GitHub issueHi, I’m using create-react-app
for my project and I followed the instructions listed in the documentation located here:
https://kea.js.org/guide/installation
The instructions I followed was Adding to apps made with create-redux-app.
After running through all of the following I npm start
my application and I’m receiving the following errors.
ReferenceError: regeneratorRuntime is not defined
I figured this might just be an issue with the node_modules
so I removed the entire node_modules folder and went ahead and re-installed all the packages using npm install
since everything I installed the previous time had the --save
flag, so essentially that would give me a clean copy of all my dependencies. Still receiving the same error.
Am I missing something??
This is what my package.json
looks like:
{
"name": "app",
"version": "0.1.0",
"private": true,
"dependencies": {
"bulma": "^0.5.1",
"custom-react-scripts": "^0.1.4",
"flow-bin": "^0.52.0",
"font-awesome": "^4.7.0",
"history": "^4.6.3",
"husky": "^0.14.3",
"kea": "^0.20.8",
"lint-staged": "^4.0.2",
"node-sass-chokidar": "0.0.3",
"npm-run-all": "^4.0.2",
"prettier": "^1.5.3",
"react": "^15.6.1",
"react-dom": "^15.6.1",
"react-redux": "^5.0.6",
"react-router-dom": "^4.1.2",
"react-router-redux": "^4.0.8",
"redux": "^3.7.2",
"redux-saga": "^0.15.6",
"reselect": "^3.0.1"
},
"lint-staged": {
"src/**/*.{js,jsx,json,css}": [
"prettier --single-quote --write",
"git add"
]
},
"scripts": {
"start-js": "react-scripts start",
"start": "npm-run-all -p watch-css start-js",
"build": "npm run build-css && react-scripts build",
"flow": "flow",
"precommit": "lint-staged",
"build-css": "node-sass-chokidar src/ -o src/",
"watch-css": "npm run build-css && node-sass-chokidar src/ -o src/ --watch --recursive",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject",
"storybook": "start-storybook -p 6006",
"build-storybook": "build-storybook"
},
"devDependencies": {
"@storybook/react": "^3.2.3"
}
}
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (3 by maintainers)
Top GitHub Comments
Hey, something changed with the latest
create-react-app
, released August 9th. I’m not sure what brokeregenerator
andbabel-polyfill
, but searching for the error “ReferenceError: regeneratorRuntime is not defined” gives many results of projects with similar problems.However, it appears that the real fix was to move
kea
to usebabel-runtime
. So starting with0.22
, kea should work again with CRA.I solved this issue by ejecting and inserting the runtime requirement in the polyfills.js If you are not scared to eject follow this steps:
yarn add babel-plugin-transform-runtime babel-plugin-transform-decorators-legacy
require('regenerator-runtime/runtime');
to theconfig/polyfills.js
file, so its executed in babel entry point.