最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Error while loading remote module in angular module federation. TypeError: Cannot read properties of undefined (rea

programmeradmin4浏览0评论

This query is regarding loading remote module in host (shell) application. I am using Angular 16.2.12.

Code to load remote module is as below:

 const routes: Routes = [

    { 
    path: 'cat', 
   
    loadChildren: () => {
      return loadRemoteModule( {
        
        remoteEntry: REMOTE_MODULE,
        remoteName: "CatModule",
        exposedModule: "./CatModule"
      }).then( m=> m.CatModule).catch( err => console.log(err))
    }
  }];

however currently getting error while loading module in host app (shell), here are error details

ERROR Error: Uncaught (in promise): TypeError: Cannot read properties of undefined (reading 'ɵmod')

TypeError: Cannot read properties of undefined (reading 'ɵmod')
    at getNgModuleDef (core.mjs:2055:29)
    at new NgModuleRef (core.mjs:22683:29)
    at NgModuleFactory.create (core.mjs:22721:16)
    at router.mjs:4160:40
    at map.js:7:37
    at OperatorSubscriber._next (OperatorSubscriber.js:13:21)
    at OperatorSubscriber.next (Subscriber.js:31:18)
    at subscribe.innerComplete (mergeInternals.js:25:28)
    at OperatorSubscriber._next (OperatorSubscriber.js:13:21)
    at OperatorSubscriber.next (Subscriber.js:31:18)
    at getNgModuleDef (core.mjs:2055:29)
    at new NgModuleRef (core.mjs:22683:29)
    at NgModuleFactory.create (core.mjs:22721:16)
    at router.mjs:4160:40
    at map.js:7:37
    at OperatorSubscriber._next (OperatorSubscriber.js:13:21)
    at OperatorSubscriber.next (Subscriber.js:31:18)
    at subscribe.innerComplete (mergeInternals.js:25:28)
    at OperatorSubscriber._next (OperatorSubscriber.js:13:21)
    at OperatorSubscriber.next (Subscriber.js:31:18)
    at resolvePromise (zone.js:1193:31)
    at resolvePromise (zone.js:1147:17)
    at zone.js:1260:17
    at _ZoneDelegate.invokeTask (zone.js:402:31)
    at core.mjs:10757:55
    at AsyncStackTaggingZoneSpec.onInvokeTask (core.mjs:10757:36)
    at _ZoneDelegate.invokeTask (zone.js:401:60)
    at Object.onInvokeTask (core.mjs:11070:33)
    at _ZoneDelegate.invokeTask (zone.js:401:60)
    at Zone.runTask (zone.js:173:47)

Help is appreciated. Thanks.

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论