Skip to content

Angular 6 lazyloaded modules - chunks not generated when build in symlinked path #11653

Closed
@TroelsWibergJensen

Description

@TroelsWibergJensen

Bug Report or Feature Request (mark with an x)

- [x ] bug report -> please search issues before submitting
- [ ] feature request

Command (mark with an x)

- [ ] new
- [x ] build
- [ ] serve
- [ ] test
- [ ] e2e
- [ ] generate
- [ ] add
- [ ] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc

Versions

$ npm -v
6.2.0

$ ng -v

Angular CLI: 6.0.8
Node: 10.4.1
OS: win32 x64
Angular: 6.0.7
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

Package Version

@angular-devkit/architect 0.6.8
@angular-devkit/build-angular 0.6.8
@angular-devkit/build-optimizer 0.6.8
@angular-devkit/core 0.6.8
@angular-devkit/schematics 0.6.8
@angular/cdk 6.3.1
@angular/cli 6.0.8
@angular/material 6.3.1
@ngtools/webpack 6.0.8
@schematics/angular 0.6.8
@schematics/update 0.6.8
rxjs 6.2.1
typescript 2.7.2
webpack 4.8.3

Repro steps

Have an angular 6 app with lazy loaded modules. It build fine in both dev and prod configuration at its normal path. When we build it with a symlinked path pointing to the app directory it fails with this error, and the module chunks are missing (i.e 0.js, ..., x.js):

Date: 2018-07-25T13:19:28.110Z
Hash: 30a42f47a6b01e52d17b
Time: 24573ms
chunk {0} runtime.js (runtime) 1.07 kB [entry] [rendered]
chunk {1} vendor.js (vendor) 404 kB [initial] [rendered]
chunk {2} styles.css (styles) 106 kB [initial] [rendered]
chunk {3} polyfills.js (polyfills) 147 kB [initial] [rendered]
chunk {4} main.js (main) 9.83 kB [initial] [rendered]

WARNING in ../node_modules/@angular/core/fesm5/core.js
4863:15-36 Critical dependency: the request of a dependency is an expression

WARNING in ../node_modules/@angular/core/fesm5/core.js
4875:15-102 Critical dependency: the request of a dependency is an expression

It makes no difference if we use the --preserve-symlinks commandline option (which worked in V5) nor "preserveSymlinks": true in architect.build.options

The log given by the failure

Date: 2018-07-25T13:19:28.110Z
Hash: 30a42f47a6b01e52d17b
Time: 24573ms
chunk {0} runtime.js (runtime) 1.07 kB [entry] [rendered]
chunk {1} vendor.js (vendor) 404 kB [initial] [rendered]
chunk {2} styles.css (styles) 106 kB [initial] [rendered]
chunk {3} polyfills.js (polyfills) 147 kB [initial] [rendered]
chunk {4} main.js (main) 9.83 kB [initial] [rendered]

WARNING in ../node_modules/@angular/core/fesm5/core.js
4863:15-36 Critical dependency: the request of a dependency is an expression

WARNING in ../node_modules/@angular/core/fesm5/core.js
4875:15-102 Critical dependency: the request of a dependency is an expression

Desired functionality

Make build work under symlinks in Angular V6.

Mention any other details that might be useful

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions