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.

ChunkLoadError when service prod resources

See original GitHub issue

After stumbling across this plugin via your MicroFrontEnd Architecture article i’ve been playing around with it for my build and had it working very successfully while both apps were running inside webpack-dev-server.

Its a very simple setup, App (A) dynamically loads a single react component from App (B).

I then did a full prod build (B) and served the dist folder locally with the npm serve package. After switching the import url in (A) to point at (B)'s dist server, the import started throwing a ChunkLoadError at bootstrap:259 (inside the onScriptComplete function).

I can see in the network logs that both the importManifest.js and the chunk file itself have been loaded into the browser successfully, so I’m totally lost as to why there’s a behaviour change.

Any suggestions on what to poke next?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
ScriptedAlchemycommented, Feb 3, 2020

The file gets there but webpack is still registering the chunk modules. It resolves a little too soon. So it appears as if it should work. All resources are there. Yet one loop is still running for a few ms longer.

It’s hard to connect all the dots because of how templates are written. So I’m writing strings. Found this issue yesterday when I started working on tree shakes. Follow me on twitter or watch the repo. I’ll have a release soon

0reactions
ScriptedAlchemycommented, Feb 5, 2020

@obfu5c8 this fixes it https://github.com/ScriptedAlchemy/webpack-external-import/pull/111

Working on some cleanup and will release in a few days. Need to validate the rewrite still handles errors as expected

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 >
ChunkLoadError Loading chunk {number} failed. #469 - GitHub
I have lazy load routes. I have checked and when I go to the page.it tries to download the previous version chunk js...
Read more >
Angular Uncaught (in promise): ChunkLoadError: Loading ...
The difference I have in production compare to stg is just. I call enableProdMode();. I have the service worker setup like this :...
Read more >
Troubleshooting "ChunkLoadError" in DSM Storybook
If you run into an error “ChunkLoadError: Loading Chunk X Failed” on Storybook 6.2+, the below workaround may solve it.
Read more >
Solved: Unable to create or edit a page on Confluence as t...
The page does not load and I receive a chunk load error: Does anyone know how to resolve? Failed to load resource: net:: ......
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