cli-universal-demo icon indicating copy to clipboard operation
cli-universal-demo copied to clipboard

build error with loadChildren modules

Open duyfe opened this issue 7 years ago • 0 comments

I'm download your project and try to add children module to RouterModule like

{ path: 'test' , loadChildren: 'app/test/test.module#TestModule'}

and build : npm run start then it show error An error occured during the build: Error: No module factory available for dependency type: ContextElementDependency at Compilation.addModuleDependencies (C:\Users\ngocduy.pham\Desktop\cli-universal-demo-master\node_modules\@angular\cli\node_modules\webpack\lib\Compilation.js:210:21) at Compilation.processModuleDependencies (C:\Users\ngocduy.pham\Desktop\cli-universal-demo-master\node_modules\@angular\cli\node_modules\webpack\lib\Compilation.js:199:8) at _this.buildModule.err (C:\Users\ngocduy.pham\Desktop\cli-universal-demo-master\node_modules\@angular\cli\node_modules\webpack\lib\Compilation.js:340:13) at building.forEach.cb (C:\Users\ngocduy.pham\Desktop\cli-universal-demo-master\node_modules\@angular\cli\node_modules\webpack\lib\Compilation.js:144:27) at Array.forEach (native) at callback (C:\Users\ngocduy.pham\Desktop\cli-universal-demo-master\node_modules\@angular\cli\node_modules\webpack\lib\Compilation.js:144:13) at module.build (C:\Users\ngocduy.pham\Desktop\cli-universal-demo-master\node_modules\@angular\cli\node_modules\webpack\lib\Compilation.js:171:11) at resolveDependencies (C:\Users\ngocduy.pham\Desktop\cli-universal-demo-master\node_modules\@angular\cli\node_modules\webpack\lib\ContextModule.js:160:4) at ContextModule.result.resolveDependencies (C:\Users\ngocduy.pham\Desktop\cli-universal-demo-master\node_modules\@ngtools\webpack\src\plugin.js:261:25) at ContextModule.build (C:\Users\ngocduy.pham\Desktop\cli-universal-demo-master\node_modules\@angular\cli\node_modules\webpack\lib\ContextModule.js:105:8) at Compilation.buildModule (C:\Users\ngocduy.pham\Desktop\cli-universal-demo-master\node_modules\@angular\cli\node_modules\webpack\lib\Compilation.js:146:10) at factoryCallback (C:\Users\ngocduy.pham\Desktop\cli-universal-demo-master\node_modules\@angular\cli\node_modules\webpack\lib\Compilation.js:329:11) at C:\Users\ngocduy.pham\Desktop\cli-universal-demo-master\node_modules\@angular\cli\node_modules\webpack\lib\ContextModuleFactory.js:96:13 at C:\Users\ngocduy.pham\Desktop\cli-universal-demo-master\node_modules\tapable\lib\Tapable.js:268:11 at done.then (C:\Users\ngocduy.pham\Desktop\cli-universal-demo-master\node_modules\@ngtools\webpack\src\plugin.js:263:28) No module factory available for dependency type: ContextElementDependency

can you help me? please!

duyfe avatar Sep 21 '17 08:09 duyfe