angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

Lazy loading fails for v5 production builds

Open StephenFluin opened this issue 9 years ago • 5 comments

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

  1. yarn
  2. ng build -prod
  3. cd dist
  4. python -m SimpleHTTPServer
  5. 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

StephenFluin avatar Oct 25 '17 00:10 StephenFluin

Facing same issue

nishantagrawal25 avatar Oct 26 '17 14:10 nishantagrawal25

facing exactly the same issue, in prod build only tested on 5.0.0-rc.6 and cli version 1.5.0-rc.3

ubaidazad avatar Oct 26 '17 14:10 ubaidazad

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

jponeill avatar Oct 26 '17 14:10 jponeill

Fixed in https://github.com/angular/angular-cli/pull/8188 but not released yet. Will be in the next release.

filipesilva avatar Oct 26 '17 15:10 filipesilva

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.