小编Gwe*_*met的帖子

SSR Angular 8应用程序具有未定义的延迟加载模块

我试图将Angular 8应用程序设置为与SSR一起运行,但是当我使用时,我的延迟加载模块在webpack中触发了一些未定义的错误ng serve。在使用Angular 7之前,它运行良好,但是转到Angular 8时,一切都变了。这是我在运行时遇到的错误(在节点控制台中)

ERROR Error: Uncaught (in promise): TypeError: Cannot read property 'call' of undefined
TypeError: Cannot read property 'call' of undefined
    at __webpack_require__ (/Users/gwenaellarmet/Documents/Projects/ng-nouma/dist/server.js:137403:30)
    at Function.requireEnsure [as e] (/Users/gwenaellarmet/Documents/Projects/ng-nouma/dist/server.js:137422:25)
    at ?11 (/Users/gwenaellarmet/Documents/Projects/ng-nouma/dist/server.js:139660:6210)
    at RouterConfigLoader.loadModuleFactory (/Users/gwenaellarmet/Documents/Projects/ng-nouma/dist/server.js:232758:39)
Run Code Online (Sandbox Code Playgroud)

我尝试更改一些tsconfig和angular.json配置,但是我总是遇到相同的错误。常春藤未启用,因为它还会在构建时触发一些错误。我认为它是链接的,但我不确定,所以现在我试图在没有常春藤的情况下使它工作

ERROR in src/app/pages/search/search.module.ts(68,12): error TS-991010: Value at position 12 in the NgModule.importss of SearchModule is not a reference: [object Object]
src/app/app.module.ts(41,12): error TS-991010: Value at position 6 in the NgModule.importss of AppModule is not a reference: [object Object]
Run Code Online (Sandbox Code Playgroud)

tsconfig.json …

lazy-loading typescript webpack ssr angular

4
推荐指数
1
解决办法
1917
查看次数

标签 统计

angular ×1

lazy-loading ×1

ssr ×1

typescript ×1

webpack ×1