Skip to content

Nested lazyload modules #331

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

Closed
1 of 3 tasks
wnabil opened this issue Jun 8, 2018 · 1 comment
Closed
1 of 3 tasks

Nested lazyload modules #331

wnabil opened this issue Jun 8, 2018 · 1 comment
Labels

Comments

@wnabil
Copy link
Contributor

wnabil commented Jun 8, 2018

I'm submitting a...

  • Bug report
  • Feature request
  • Documentation issue or request

Current behavior

i got an error after upgrading my project to latest version, the nested lazyloaded modules seems to be broken
Cannot find 'SubModule' in './sub/sub.module'

Expected behavior

Nested lazyloaded modules should work and successfully load the next chunk

Minimal reproduction of the problem with instructions

create a lazyloaded module for example called "MainModule".
create another lazyloaded module inside your first module "SubModule" and call it by
{ path: 'sub', loadChildren: './sub/sub.module#SubModule' }
inside the main routes of the main module

Environment

- generator version: 5.0.0
- node version: 9.0.0  <!-- run `node --version` -->
- npm version: 5.5.1  <!-- run `npm --version` -->
- OS:  All

Others:
The compiler displays no error and the file is loaded without problems, only when you try to load the chunk on the browser you receive this error
It was working on version 4x.

untitled

@wnabil
Copy link
Contributor Author

wnabil commented Jun 9, 2018

After diving into this problem i found that it is not a lazyload issue, the issue because in angular 6 they removed the global var, i do not know why it is showing a wrong error but in order to fix this just switch to window or declare global in polyfills.ts file as described here
angular/angular-cli#8160 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants