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.

Cannot change the 'read' location for chunks

See original GitHub issue

Please provide us with the following information:

OS?

Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?) Windows 10 x64

Versions.

Please run ng --version. If there’s nothing outputted, please run in a Terminal: node --version and paste the result here:

@angular/cli: 1.0.0-beta.30 node: 7.5.0 os: win32 x64 @angular/common: 2.4.6 @angular/compiler: 2.4.6 @angular/core: 2.4.6 @angular/forms: 2.4.6 @angular/http: 2.4.6 @angular/platform-browser: 2.4.6 @angular/platform-browser-dynamic: 2.4.6 @angular/router: 3.4.6 @angular/upgrade: 2.4.6 @angular/cli: 1.0.0-beta.30 @angular/compiler-cli: 2.4.6

Repro steps.

Was this an app that wasn’t created using the CLI? What change did you do on your code? etc.

I have a couple of lazy routes and everything is compiled and generated in “webapproot/ng/dist/” The problem is that even though in my index.html I’m referencing the scripts like this

<script src="/ng/dist/inline.bundle.js"></script> <script src="/ng/dist/polyfills.bundle.js"></script> <script src="/ng/dist/styles.bundle.js"></script> <script src="/ng/dist/vendor.bundle.js"></script> <script src="/ng/dist/main.bundle.js"></script>

the lazy routes chunks always try to load from ‘/0.chunk.js’ instead of ‘/ng/dist/0.chunk.js’

Is there any way to instruct the cli/angular to read the chunks for the proper folder?

The log given by the failure.

Normally this include a stack trace and some more information.

Mention any other details that might be useful.


Thanks! We’ll be in touch soon.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:14
  • Comments:23

github_iconTop GitHub Comments

29reactions
anatolie-dariicommented, May 30, 2017

I managed to make it work by adding “deployUrl” : “/ng/dist/”, in apps in .angular-cli.json

9reactions
papaiatiscommented, Feb 24, 2017

I would also love to see an option to change where the chunk files are served from.

My app folder structure looks like this:

- css
--- styles.css
- js
--- bundle.js
--- 0.chunk.js
--- 1.chunk.js
index.html

My lazy loaded paths cannot be loaded because the chunks are trying to be loaded from localhost:3000/0.chunk.js instead of localhost:3000/js/0.chunk.js. To make it work, I have to build all the js files into the root folder.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Solve the Chunk Load Error in JavaScript - Rollbar
Whenever there's an error observed in dynamically fetching helper JavaScript files known as Chunks, a ChunkLoad Error is thrown.
Read more >
Webpack Code Splitting 'Loading chunk failed' error wrong file ...
Apparently it doesn't fetch missing chunk but takes from a bundle. It does beat the purpose of the chunking in the first place, ......
Read more >
16.6 The working directory for R code chunks | R Markdown ...
By default, the working directory for R code chunks is the directory that contains the Rmd document. For example, if the path of...
Read more >
The 100% correct way to split your chunks with Webpack
13 min read ... That second one sounds far more appealing, doesn't it? ... Each week when we push some new changes to...
Read more >
Cannot open chunk '<CHUNKFILE PATH>'. errno = 13 - IBM
The 'informix' user which runs command does not have the appropriate permission's to read and write to the directory that contains the chunk...
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