Skip to content

ngtools: listLazyRoutes() called with entryRoute normalized in non-standard way #13531

Closed
@gkalpak

Description

@gkalpak

🐞 Bug report

Command (mark with an x)

- [x] build
- [x] serve

Is this a regression?

N/A

Description

When ngtools callls ngProgram.listLazyRoutes() it may optionally pass an entryRoute. This route is based on entryModule.path, which is in turn resolved from _mainPath, which is in turn resolved by the custom compiler host, which normalizes paths in a proprietary way (e.g. converting Windows paths like this: C:\foo\bar --> /C/foo/bar).

This is different than how, for example, TS normalizes Windows paths (i.e. C:\foo\bar --> C:/foo/bar), which means that listLazyRoutes() implementations need to be aware of the cli normalization logic and perform similar normalization when trying to match entryRoute with their available routes.

🔬 Minimal Reproduction

🌍 Your Environment

Angular CLI: 7.3.0-rc.0
Node: 10.15.0
OS: win32 x64
Angular: 8.0.0-beta.1+28.sha-e2c98fb
... animations, common, compiler, core, forms, language-service
... platform-browser, platform-browser-dynamic, router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.13.0-rc.0
@angular-devkit/build-angular     0.13.0-rc.0
@angular-devkit/build-optimizer   0.13.0-rc.0
@angular-devkit/build-webpack     0.13.0-rc.0
@angular-devkit/core              7.3.0-rc.0
@angular-devkit/schematics        7.3.0-rc.0
@angular/cli                      7.3.0-rc.0
@angular/compiler-cli             8.0.0-beta.1+39.sha-d5ded04.with-local-changes
@ngtools/webpack                  7.3.0-rc.0
@schematics/angular               7.3.0-rc.0
@schematics/update                0.13.0-rc.0
rxjs                              6.3.3
typescript                        3.2.4
webpack                           4.29.0

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions