question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

no chunks created when lazy loading...

See original GitHub issue

problem

I am using ng-cli with lazy loading:

...
{path: 'studioweb', pathMatch: 'full', redirectTo: '/App1/Dashboard'},  // IE/FF compatibility
    {
        path: 'App1', component: Appwrap,
        children: [
            {path: '', component: Appwrap, canActivate: [AuthService]},
            {path: 'Dashboard', component: Dashboard, data: {title: 'Dashboard'}, canActivate: [AuthService]},
            {path: 'Campaigns', loadChildren: '../app/campaigns/index#CampaignsLazyModule', data: {title: 'Campaigns'}, canActivate: [AuthService]},
            {path: 'Fasterq', loadChildren: '../app/fasterq/index#FasterqLazyModule', data: {title: 'Fasterq'}, canActivate: [AuthService]},
...

I generate the build dist with:

ng build --target=production --base-href ./

and I don’t see any chunks. and while all “seems” to work, I am not sure lazy loading is working, almost as if Webpack bundles it all in?!?!?!

How can I confirm if lazy loading is working? Why are chunks not created? bug?

OS?

angular-cli: 1.0.0-beta.25.5 node: 6.5.0 os: win32 x64 @angular/common: 2.4.4 @angular/compiler: 2.4.4 @angular/core: 2.4.4 @angular/forms: 2.4.4 @angular/http: 2.4.4 @angular/language-service: 2.4.4 @angular/platform-browser: 2.4.4 @angular/platform-browser-dynamic: 2.4.4 @angular/router: 3.2.1 @angular/compiler-cli: 2.4.4

snap:

nochunks

Angular 2 Kitchen sink: http://ng2.javascriptninja.io and source@ https://github.com/born2net/Angular-kitchen-sink Regards,

Sean

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
born2netcommented, Jan 19, 2017

that issue is closed… please advise … also I don’t believe its the same issue. that bug indicates lazy loading not working, I am not sure if its working or not but chunks are not being created

2reactions
mitsukikaminagacommented, Dec 14, 2017

In my case, I remove the lazy load module from “imports” in app.module.ts and it’s solved.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Lazy Loading, no chunks - Angular 7 - Stack Overflow
I'm trying to do Lazy Loading, and followed the steps in the official docs of angular. The problem is that there is no...
Read more >
Common Chunk and Lazy Loading in Angular - | juri.dev
What we're going to look at in this article is lazy loading in Angular, but in specific about the “common chunk” and the...
Read more >
Webpack lazy-loading chunks - CodeX Team
Webpack supports splitting files to separate modules out of a box. This note will show you how to start using Webpack chunks and...
Read more >
Lazy Loading | webpack
The code there does cause a separate chunk, lodash.bundle.js , to be generated and technically "lazy-loads" it as soon as the script is...
Read more >
Lazy Loading Guide - Spartacus Documentation - SAP
Lazy loading, also known as code splitting, lets you divide your JavaScript code into multiple chunks. The result is that you do not...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found