-
Notifications
You must be signed in to change notification settings - Fork 12k
Can't have nested lazy routed modules from a library #13143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
The root cause of this is also related to #12859 |
@alan-agius4 I don't see the direct link with the issue you're pointing to. Maybe i'm missing some basePath configuration or something in the configuration of my "admin" library. Note that I can't find anywere a reported issue that describes the same error than me, does that mean no one ever tried to lazy load a library that has lazy loaded routing itself ? |
Hi, the problem is that lazy loaded routes are being resolved using TypeScript resolution which would result in the At the moment, to achieve lazy loaded modules from a library, you'd need to create a proxy module which registers the library module into the application and defines the route there rather than the library itself. |
Ok @alan-agius4 thanks for the precisions |
Closing this in favour of #6373 (comment) |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Bug Report or Feature Request (mark with an
x
)Command (mark with an
x
)Versions
$ node --version
v8.11.3
$ npm --version
5.6.0
Angular CLI: 6.2.7
Node: 8.11.3
OS: win32 x64
Angular: 6.1.10
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, platform-server, router
Package Version
@angular-devkit/architect 0.8.8
@angular-devkit/build-angular 0.8.8
@angular-devkit/build-ng-packagr 0.10.7
@angular-devkit/build-optimizer 0.8.8
@angular-devkit/build-webpack 0.8.8
@angular-devkit/core 0.8.8
@angular-devkit/schematics 0.8.7
@angular/cdk 6.4.7
@angular/cli 6.2.7
@angular/material 6.4.7
@ngtools/json-schema 1.1.0
@ngtools/webpack 6.2.8
@schematics/angular 0.8.7
@schematics/update 0.8.7
ng-packagr 4.4.0
rxjs 6.3.3
typescript 2.7.2
webpack 4.16.4
Repro steps
The log given by the failure
ERROR in Could not resolve module ./users/users.module relative to /C/Workspace/angular6-libtest/dist/admin/admin.d.ts
Desired functionality
We should be able to run an app with a lazy routed module that has itself lazy routed submodules.
Mention any other details that might be useful
The error occurs because
admin.d.ts
tries to resolve lazy routes of the module but is one level above in the dist/ hierarchy than the admin-routing.module that declares the routes initially.The file
admin.d.ts
should be in the lib/ folder so it would work.The text was updated successfully, but these errors were encountered: