When using the Parcel
front-end packaging tool to start the local service, the console
console reports an error: Uncaught ReferenceError: regeneratorRuntime is not defined
, according to the information: regeneratorRuntime
it is a global auxiliary function generated by the packaging tool, which is babel
generated and is used for compatible async/await
syntax, so you need to configure the corresponding babel
plugin.
First, configure babel
There are two ways to configure the babel
plugin :
1. Create a separate configuration file .babelrc
.
Under the window
system, a file whose name starts with .
cannot be generated directly, but it can be generated by using the command echo
on the cmd
command line. The operation is as follows:
echo > .babelrc
Edit the .babelrc
file and configure it as follows:
{ "plugins": [ '@babel/plugin-transform-runtime' ]}
2. Configure babel
in package.json
"babel": { "plugins": [ '@babel/plugin-transform-runtime' ]}
After the configuration is successful, restart the service, and Parcel
the dependencies will be downloaded and installed automatically, without manual operation npm install
, which is really friendly.
2. Summary
Note: package.json
higher than .babelrc
the weight.
If the project is not too complicated, it is highly recommended to use Parcel
to build web applications, which is absolutely worry-free, convenient and fast.
Read More:
- How to Solve Import antd Error: Module build failed
- How to Solve [error] malformed \uxxxx encoding Error
- Solution of Vue router loading components on demand
- [Solved] webpack.config.js configuration encountered Error: Cannot find module’@babel/core’&&Cannot find module’@babel/plugin-transform-react-jsx’
- [Solved] Maven Error: The packaging for this project did not assign a file to the build artifact
- Vue Package Error: npm ERR! missing script: build
- Webpack Pack and compress ES6 files with errors: ERROR in js/xxxxxx.js from UglifyJs Unexpected token punc ()
- An error was reported when Maven package was running the packaged jar package: there is no main list attribute in xxx.jar, which can be solved by configuring Maven plugin
- [Maven] Pom.xml error: Cannot detect Web Project version.
- How to Solve Gradle Error: Plugin with id ‘jetty’ not found.
- [Webpack Update] vue-loader Error: Compiled with problems : ERRORModule notfound: Error:Can‘ t resolve vue in
- Error: Comments are not permitted in JSON [How to Solve]
- [Solved] eslint Error: error Parsing error: Unexpected token <
- [Solved] Lumen Error: Class redis does not exist
- The browser is compatible with IE11 “ReferenceError: ‘Promise’ is not defined” “ReferenceError: ‘Promise’ is not defined”
- [Solved] Postcss Error: Invalid options object. PostCSS Loader has been initialized using an options object that does not match the API schema.
- [Solved] CXF Call webservice Client Error: 2 counts of InaccessibleWSDLException
- Maven Packaging ERROR: Some problems were encountered while processing the POMs
- Maven package error: [WARNING] The POM for xxx is missing, no dependency inform