Lazy loading fails for v5 production builds
Bug Report
- [X] bug report -> please search issues before submitting
Versions.
_ _ ____ _ ___
/ \ _ __ __ _ _ _| | __ _ _ __ / ___| | |_ _|
/ △ \ | '_ \ / _` | | | | |/ _` | '__| | | | | | |
/ ___ \| | | | (_| | |_| | | (_| | | | |___| |___ | |
/_/ \_\_| |_|\__, |\__,_|_|\__,_|_| \____|_____|___|
|___/
Angular CLI: 1.5.0-rc.3
Node: 8.4.0
OS: linux x64
Angular: 5.0.0-rc.5
... animations, common, compiler, compiler-cli, core, forms
... http, platform-browser, platform-browser-dynamic, router
@angular/cli: 1.5.0-rc.3
@angular/language-service: 4.4.6
@angular/tsc-wrapped: 5.0.0-beta.7
@angular-devkit/build-optimizer: 0.0.31
@angular-devkit/core: 0.0.20
@angular-devkit/schematics: 0.0.34
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 1.8.0-rc.3
@schematics/angular: 0.0.48
typescript: 2.5.3
webpack: 3.8.1
Repro steps.
https://github.com/StephenFluin/v5-lazy-repro
1.checkout
- yarn
- ng build -prod
- cd dist
- python -m SimpleHTTPServer
- Navigate to http://localhost:8000
The log given by the failure.
Error: Cannot find module './lazy/lazy.module.ngfactory'.
at t (main.2598e91f85232d1cc5c5.bundle.js:1)
at t.LMZF.t.loadFactory (vendor.b11bf1d51f4da8a2b12e.bundle.js:1)
at t.LMZF.t.load (vendor.b11bf1d51f4da8a2b12e.bundle.js:1)
at t.UHIZ.t.loadModuleFactory (vendor.b11bf1d51f4da8a2b12e.bundle.js:1)
at t.UHIZ.t.load (vendor.b11bf1d51f4da8a2b12e.bundle.js:1)
at e.project (vendor.b11bf1d51f4da8a2b12e.bundle.js:1)
at e._tryNext (vendor.b11bf1d51f4da8a2b12e.bundle.js:1)
at e._next (vendor.b11bf1d51f4da8a2b12e.bundle.js:1)
at e.E9/g.e.next (vendor.b11bf1d51f4da8a2b12e.bundle.js:1)
at e._subscribe (vendor.b11bf1d51f4da8a2b12e.bundle.js:1)
at t (main.2598e91f85232d1cc5c5.bundle.js:1)
at t.LMZF.t.loadFactory (vendor.b11bf1d51f4da8a2b12e.bundle.js:1)
at t.LMZF.t.load (vendor.b11bf1d51f4da8a2b12e.bundle.js:1)
at t.UHIZ.t.loadModuleFactory (vendor.b11bf1d51f4da8a2b12e.bundle.js:1)
at t.UHIZ.t.load (vendor.b11bf1d51f4da8a2b12e.bundle.js:1)
at e.project (vendor.b11bf1d51f4da8a2b12e.bundle.js:1)
at e._tryNext (vendor.b11bf1d51f4da8a2b12e.bundle.js:1)
at e._next (vendor.b11bf1d51f4da8a2b12e.bundle.js:1)
at e.E9/g.e.next (vendor.b11bf1d51f4da8a2b12e.bundle.js:1)
at e._subscribe (vendor.b11bf1d51f4da8a2b12e.bundle.js:1)
at u (polyfills.30ded0cb13379e3a674b.bundle.js:1)
at u (polyfills.30ded0cb13379e3a674b.bundle.js:1)
at polyfills.30ded0cb13379e3a674b.bundle.js:1
at e.invokeTask (polyfills.30ded0cb13379e3a674b.bundle.js:1)
at Object.onInvokeTask (vendor.b11bf1d51f4da8a2b12e.bundle.js:1)
at e.invokeTask (polyfills.30ded0cb13379e3a674b.bundle.js:1)
at r.runTask (polyfills.30ded0cb13379e3a674b.bundle.js:1)
at o (polyfills.30ded0cb13379e3a674b.bundle.js:1)
at <anonymous>```
### Desired functionality.
Lazy loaded modules to build
Facing same issue
facing exactly the same issue, in prod build only tested on 5.0.0-rc.6 and cli version 1.5.0-rc.3
I'm seeing a similar error w/ -aot -build-optimizer builds on rc.5 and cli version rc.3. Doesn't happen w/ cli rc.2
Fixed in https://github.com/angular/angular-cli/pull/8188 but not released yet. Will be in the next release.
This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.