Closed kangyanyan closed 5 years ago
子应用创建步骤不太清楚,关键错误 mooa.es5.js:545 Cannot mount hell because that is not bootstraped (anonymous) @ mooa.es5.js:545 希望帮忙解决,想要应用mooa框架
文档中的步骤 3 就是子应用相关的步骤 -> https://github.com/phodal/mooa#3-config-app
全新的angular cli项目,结合文档中的步骤 3 。build --prod,打包之后单独的子应用可以访问。结合到主项目之后跳转会报错。
我这里得到的信息太少了,你能提供配置文件或者吗? 这里是示例子工程应用:https://github.com/phodal/mooa-boilerplate
我提交的子应用src代码
https://github.com/kangyanyan/mooatest
@kangyanyan 你能提供一下配置文件吗?
@kangyanyan
mooaPlatform.mount('help').then((opts) => { platformBrowserDynamic().bootstrapModule(AppModule).then((module) => { opts['attachUnmount'](module); }); });
这段示例代码中的mount('help'),记得要把help改成你自己的子应用名称
mooa.es5.js:545 Cannot mount hell because that is not bootstraped (anonymous) @ mooa.es5.js:545 ZoneAwarePromise @ zone.js:891 mount @ mooa.es5.js:532 (anonymous) @ mooa.es5.js:736 step @ mooa.es5.js:55 (anonymous) @ mooa.es5.js:36 (anonymous) @ mooa.es5.js:29 ZoneAwarePromise @ zone.js:891 __awaiter @ mooa.es5.js:25 toMountPromise @ mooa.es5.js:723 (anonymous) @ mooa.es5.js:1204 step @ mooa.es5.js:55 (anonymous) @ mooa.es5.js:36 fulfilled @ mooa.es5.js:26 push../node_modules/_zone.js@0.8.26@zone.js/dist/zone.js.ZoneDelegate.invoke @ zone.js:388 onInvoke @ core.js:16156 push../node_modules/_zone.js@0.8.26@zone.js/dist/zone.js.ZoneDelegate.invoke @ zone.js:387 push../node_modules/_zone.js@0.8.26@zone.js/dist/zone.js.Zone.run @ zone.js:138 (anonymous) @ zone.js:872 push../node_modules/_zone.js@0.8.26@zone.js/dist/zone.js.ZoneDelegate.invokeTask @ zone.js:421 onInvokeTask @ core.js:16147 push../node_modules/_zone.js@0.8.26@zone.js/dist/zone.js.ZoneDelegate.invokeTask @ zone.js:420 push../node_modules/_zone.js@0.8.26@zone.js/dist/zone.js.Zone.runTask @ zone.js:188 drainMicroTaskQueue @ zone.js:595 push../node_modules/_zone.js@0.8.26@zone.js/dist/zone.js.ZoneTask.invokeTask @ zone.js:500 invokeTask @ zone.js:1540 globalZoneAwareCallback @ zone.js:1566 error (async) customScheduleGlobal @ zone.js:1666 push../node_modules/_zone.js@0.8.26@zone.js/dist/zone.js.ZoneDelegate.scheduleTask @ zone.js:407 onScheduleTask @ zone.js:297 push../node_modules/_zone.js@0.8.26@zone.js/dist/zone.js.ZoneDelegate.scheduleTask @ zone.js:401 push../node_modules/_zone.js@0.8.26@zone.js/dist/zone.js.Zone.scheduleTask @ zone.js:232 push../node_modules/_zone.js@0.8.26@zone.js/dist/zone.js.Zone.scheduleEventTask @ zone.js:258 (anonymous) @ zone.js:1831 desc.set @ zone.js:1244 (anonymous) @ mooa.es5.js:290 ZoneAwarePromise @ zone.js:891 loadScriptPromise @ mooa.es5.js:282 (anonymous) @ mooa.es5.js:305 push../node_modules/_zone.js@0.8.26@zone.js/dist/zone.js.ZoneDelegate.invoke @ zone.js:388 onInvoke @ core.js:16156 push../node_modules/_zone.js@0.8.26@zone.js/dist/zone.js.ZoneDelegate.invoke @ zone.js:387 push../node_modules/_zone.js@0.8.26@zone.js/dist/zone.js.Zone.run @ zone.js:138 (anonymous) @ zone.js:872 push../node_modules/_zone.js@0.8.26@zone.js/dist/zone.js.ZoneDelegate.invokeTask @ zone.js:421 onInvokeTask @ core.js:16147 push../node_modules/_zone.js@0.8.26@zone.js/dist/zone.js.ZoneDelegate.invokeTask @ zone.js:420 push../node_modules/_zone.js@0.8.26@zone.js/dist/zone.js.Zone.runTask @ zone.js:188 drainMicroTaskQueue @ zone.js:595 push../node_modules/_zone.js@0.8.26@zone.js/dist/zone.js.ZoneTask.invokeTask @ zone.js:500 invokeTask @ zone.js:1540 globalZoneAwareCallback @ zone.js:1566 error (async) customScheduleGlobal @ zone.js:1666 push../node_modules/_zone.js@0.8.26@zone.js/dist/zone.js.ZoneDelegate.scheduleTask @ zone.js:407 onScheduleTask @ zone.js:297 push../node_modules/_zone.js@0.8.26@zone.js/dist/zone.js.ZoneDelegate.scheduleTask @ zone.js:401 push../node_modules/_zone.js@0.8.26@zone.js/dist/zone.js.Zone.scheduleTask @ zone.js:232 push../node_modules/_zone.js@0.8.26@zone.js/dist/zone.js.Zone.scheduleEventTask @ zone.js:258 (anonymous) @ zone.js:1831 desc.set @ zone.js:1244 (anonymous) @ mooa.es5.js:290 ZoneAwarePromise @ zone.js:891 loadScriptPromise @ mooa.es5.js:282 (anonymous) @ mooa.es5.js:305 push../node_modules/_zone.js@0.8.26@zone.js/dist/zone.js.ZoneDelegate.invoke @ zone.js:388 onInvoke @ core.js:16156 push../node_modules/_zone.js@0.8.26@zone.js/dist/zone.js.ZoneDelegate.invoke @ zone.js:387 push../node_modules/_zone.js@0.8.26@zone.js/dist/zone.js.Zone.run @ zone.js:138 (anonymous) @ zone.js:872 push../node_modules/_zone.js@0.8.26@zone.js/dist/zone.js.ZoneDelegate.invokeTask @ zone.js:421 onInvokeTask @ core.js:16147 push../node_modules/_zone.js@0.8.26@zone.js/dist/zone.js.ZoneDelegate.invokeTask @ zone.js:420 push../node_modules/_zone.js@0.8.26@zone.js/dist/zone.js.Zone.runTask @ zone.js:188 drainMicroTaskQueue @ zone.js:595 push../node_modules/_zone.js@0.8.26@zone.js/dist/zone.js.ZoneTask.invokeTask @ zone.js:500 invokeTask @ zone.js:1540 globalZoneAwareCallback @ zone.js:1566 error (async) customScheduleGlobal @ zone.js:1666 push../node_modules/_zone.js@0.8.26@zone.js/dist/zone.js.ZoneDelegate.scheduleTask @ zone.js:407 onScheduleTask @ zone.js:297 push../node_modules/_zone.js@0.8.26@zone.js/dist/zone.js.ZoneDelegate.scheduleTask @ zone.js:401 push../node_modules/_zone.js@0.8.26@zone.js/dist/zone.js.Zone.scheduleTask @ zone.js:232 push../node_modules/_zone.js@0.8.26@zone.js/dist/zone.js.Zone.scheduleEventTask @ zone.js:258 (anonymous) @ zone.js:1831 desc.set @ zone.js:1244 (anonymous) @ mooa.es5.js:318 ZoneAwarePromise @ zone.js:891 (anonymous) @ mooa.es5.js:310 push../node_modules/_zone.js@0.8.26@zone.js/dist/zone.js.ZoneDelegate.invoke @ zone.js:388 onInvoke @ core.js:16156 push../node_modules/_zone.js@0.8.26@zone.js/dist/zone.js.ZoneDelegate.invoke @ zone.js:387 push../node_modules/_zone.js@0.8.26@zone.js/dist/zone.js.Zone.run @ zone.js:138 (anonymous) @ zone.js:872 push../node_modules/_zone.js@0.8.26@zone.js/dist/zone.js.ZoneDelegate.invokeTask @ zone.js:421 onInvokeTask @ core.js:16147 push../node_modules/_zone.js@0.8.26@zone.js/dist/zone.js.ZoneDelegate.invokeTask @ zone.js:420 push../node_modules/_zone.js@0.8.26@zone.js/dist/zone.js.Zone.runTask @ zone.js:188 drainMicroTaskQueue @ zone.js:595 push../node_modules/_zone.js@0.8.26@zone.js/dist/zone.js.ZoneTask.invokeTask @ zone.js:500 invokeTask @ zone.js:1540 globalZoneAwareCallback @ zone.js:1566 core.js:14597 ERROR Error: Uncaught (in promise): Error Error at mooa.es5.js:744 at step (mooa.es5.js:55) at Object.throw (mooa.es5.js:36) at rejected (mooa.es5.js:27) at