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:
- The browser is compatible with IE11 “ReferenceError: ‘Promise’ is not defined” “ReferenceError: ‘Promise’ is not defined”
- <script setup> Error: ‘defineProps‘ is not defined [How to Solve]
- errorThrown:ReferenceError: data is not defined [How to Solve]
- [Solved] Eval Error: Uncaught ReferenceError: False is not defined
- [Solved] Uncaught ReferenceError: FileAsyncWriter is not defined
- [Solved] Electron Error: ReferenceError: require is not defined
- cloud.callFunction:fail Error:wx is not defined [How to Solve]
- [Solved] Uncaught ReferenceError: is not defined at HTMLAnchorElement.onclick
- How to Solve “parcel segmentation fault” Error in Linux
- [Solved] Error contacting service. It is probably not running.
- [Solved] Error contacting service. It is probably not running.
- How to Solve jQuery error: Uncaught ReferenceError: $ is not defined
- [Solved] Parcel Package Error: Cannot read property ‘length‘ of undefined
- VUE: Property or method “deleteFun“ is not defined on the instance but referenced during render. [How to Fix]
- [Solved] emcc error: error: LLVM_ROOT is not defined
- SharePoint site shows ‘Service Unavailable. HTTP Error 503. The service is unavailable’
- [Solved] ZooKeeper Configurate Error: Error contacting service. It is probably not running.
- [Solved] Zookeeper3.6.0 Error: Error contacting service. It is probably not running
- How to Solve VMware Workstation Error: The VMware Authorization Service is not running.
- When installing zookeeper, you can view the process start, but the status display error: Error contacting service. It is probably not running