在学习到第10章后,打包后成功运行,但是360浏览器打开网页出现错误,提示async_load.js 18行的错误,代码已经拷贝了下载的该课程的代码,无书写错误;.bablerc的配置也没错
{
“presets”: [
“env”, “stage-0”, “react”
],
“plugins”: [
“transform-runtime”,
“transform-decorators-legacy”,
“transform-class-properties”
]
}
浏览器console报错:
async_load.js:18 Uncaught ReferenceError: regeneratorRuntime is not defined
at AsyncComponent.componentDidMount (async_load.js:18)
at commitLifeCycles (react-dom.development.js:8798)
at commitAllLifeCycles (react-dom.development.js:9967)
at HTMLUnknownElement.callCallback (react-dom.development.js:540)
at Object.invokeGuardedCallbackDev (react-dom.development.js:579)
at invokeGuardedCallback (react-dom.development.js:436)
at commitRoot (react-dom.development.js:10071)
at performWorkOnRoot (react-dom.development.js:11003)
at performWork (react-dom.development.js:10952)
at requestWork (react-dom.development.js:10861)
componentDidMount @ async_load.js:18
commitLifeCycles @ react-dom.development.js:8798
commitAllLifeCycles @ react-dom.development.js:9967
callCallback @ react-dom.development.js:540
invokeGuardedCallbackDev @ react-dom.development.js:579
invokeGuardedCallback @ react-dom.development.js:436
commitRoot @ react-dom.development.js:10071
performWorkOnRoot @ react-dom.development.js:11003
performWork @ react-dom.development.js:10952
requestWork @ react-dom.development.js:10861
scheduleWorkImpl @ react-dom.development.js:10744
scheduleWork @ react-dom.development.js:10706
scheduleTopLevelUpdate @ react-dom.development.js:11177
updateContainer @ react-dom.development.js:11215
(anonymous) @ react-dom.development.js:15232
unbatchedUpdates @ react-dom.development.js:11086
renderSubtreeIntoContainer @ react-dom.development.js:15231
render @ react-dom.development.js:15296
parcelRequire.index.js.react @ index.js:20
newRequire @ src.e31bb0bc.js:49
parcelRequire…/node_modules/object-assign/index.js @ src.e31bb0bc.js:81
(anonymous) @ src.e31bb0bc.js:107
react-dom.development.js:9769 The above error occurred in the component:
in AsyncComponent (created by Route)
in Route (created by _default)
in Switch (created by _default)
in _default
in Router (created by BrowserRouter)
in BrowserRouter
Consider adding an error boundary to your tree to customize error handling behavior.
Visit https://fb.me/react-error-boundaries to learn more about error boundaries.
logCapturedError @ react-dom.development.js:9769
captureError @ react-dom.development.js:10560
commitRoot @ react-dom.development.js:10079
performWorkOnRoot @ react-dom.development.js:11003
performWork @ react-dom.development.js:10952
requestWork @ react-dom.development.js:10861
scheduleWorkImpl @ react-dom.development.js:10744
scheduleWork @ react-dom.development.js:10706
scheduleTopLevelUpdate @ react-dom.development.js:11177
updateContainer @ react-dom.development.js:11215
(anonymous) @ react-dom.development.js:15232
unbatchedUpdates @ react-dom.development.js:11086
renderSubtreeIntoContainer @ react-dom.development.js:15231
render @ react-dom.development.js:15296
parcelRequire.index.js.react @ index.js:20
newRequire @ src.e31bb0bc.js:49
parcelRequire…/node_modules/object-assign/index.js @ src.e31bb0bc.js:81
(anonymous) @ src.e31bb0bc.js:107
async_load.js:18 Uncaught ReferenceError: regeneratorRuntime is not defined
at AsyncComponent.componentDidMount (async_load.js:18)
at commitLifeCycles (react-dom.development.js:8798)
at commitAllLifeCycles (react-dom.development.js:9967)
at HTMLUnknownElement.callCallback (react-dom.development.js:540)
at Object.invokeGuardedCallbackDev (react-dom.development.js:579)
at invokeGuardedCallback (react-dom.development.js:436)
at commitRoot (react-dom.development.js:10071)
at performWorkOnRoot (react-dom.development.js:11003)
at performWork (react-dom.development.js:10952)
at requestWork (react-dom.development.js:10861)
componentDidMount @ async_load.js:18
commitLifeCycles @ react-dom.development.js:8798
commitAllLifeCycles @ react-dom.development.js:9967