Skip to content
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

Loading Chunk n Failed (In Prod) #391

Closed
MuseofMoose opened this issue Dec 6, 2019 · 11 comments
Closed

Loading Chunk n Failed (In Prod) #391

MuseofMoose opened this issue Dec 6, 2019 · 11 comments
Labels

Comments

@MuseofMoose
Copy link

MuseofMoose commented Dec 6, 2019

Hey there!

I've added ember-shepherd to my web application recently and while everything appeared to be working just fine in development, as soon as I pushed out the changes on our staging environment, I've immediately started getting "Loading chunk 4 failed" errors when the tour is first started.

I noticed in the dev environment the tour makes a request for a chunk.somelongalphanumeric.js asset and that appears to be successful but in staging, with everything built and consolidated, the chunk it is reaching out for is not there (and returns a 404).

Any ideas on what might be causing this? I don't believe I'm doing anything non-standard with the library.

Ember version: ~3.7.1
Ember Shepherd version: ^9.0.0
Reproduced in Firefox, Safari, and Chrome (did not try anything else)

Chrome network tab in dev:
Screen Shot 2019-12-06 at 1 34 15 PM

Chrome network tab in staging:
Screen Shot 2019-12-06 at 1 34 37 PM

@RobbieTheWagner
Copy link
Member

@MuseofMoose thanks for reporting this issue! Would you be able to try ember-shepherd 10 and see if that changes anything? This is definitely ember-auto-import related with the webpack chunks, but I am not sure why it is occurring.

Is ember-auto-import installed in your app? Perhaps adding it may also help.

@MuseofMoose
Copy link
Author

MuseofMoose commented Dec 7, 2019

@rwwagner90 Tried both changes but they didn't make any difference, sadly. Still getting the exact same error. Should I take this over to ember-auto-import and raise an issue there?

@RobbieTheWagner
Copy link
Member

@MuseofMoose if you could provide an isolated reproduction, that would be helpful. It may be that updating Ember or Ember CLI versions is needed or something. I am not sure.

@MuseofMoose
Copy link
Author

@rwwagner90 Fair enough. I'll do some more digging over the weekend and see if I can whip something simple up. I just noticed that doing a local ember build --prod does seem to create the expected chunk file so I'm now wondering if that chunk is getting lost during our extended build process.

Either way, I'll try and put something together or close this if I find out it's something else. I appreciate the help so far.

@MuseofMoose
Copy link
Author

@rwwagner90 Sure enough, I wasn't properly copying over the chunk files and other ember-auto-import generated files further along in my build process. How silly of me. Apologies for not realizing and thank you again for trying to help. I'll close this now.

@RobbieTheWagner
Copy link
Member

No problem! Hope you enjoy using Shepherd 😃

@joegaudet
Copy link

@MuseofMoose realize this is old, but running into the same issue, curious, did you use ember-cli-deploy to fix? And if so mind sharing your config?

@joegaudet
Copy link

@rwwagner90 I'm seeing this issue in development and production currently, thought strangely on second full load of the application it works fine.

@RobbieTheWagner
Copy link
Member

@joegaudet it sounds like before this was a problem with ember-auto-import. I don't really have any suggestions other than blowing away node modules and updating them.

@derrabauke
Copy link

@rwwagner90 Is this issue back? I can't open the demo page. https://rwwagner90.github.io/ember-shepherd/docs/demo

vendor-56be03bdc2aa34cb191a44c52d4560b2.js:1159 Error while processing route: docs.demo Loading chunk 574 failed.
(error: https://rwwagner90.github.io/ember-shepherd/docs/api/modules/ember-shepherd/utils/ADDON_DOCS_ROOT_URL/assets/chunk.574.55dd52836b50b236133f.js) ChunkLoadError: Loading chunk 574 failed.
(error: https://rwwagner90.github.io/ember-shepherd/docs/api/modules/ember-shepherd/utils/ADDON_DOCS_ROOT_URL/assets/chunk.574.55dd52836b50b236133f.js)
    at o.f.j (https://rwwagner90.github.io/ember-shepherd/assets/chunk.143.29de83d81f2618619098.js:37:20)
    at https://rwwagner90.github.io/ember-shepherd/assets/chunk.143.29de83d81f2618619098.js:24:190
    at Array.reduce (<anonymous>)
    at o.e (https://rwwagner90.github.io/ember-shepherd/assets/chunk.143.29de83d81f2618619098.js:24:168)
    at a.callback (https://rwwagner90.github.io/ember-shepherd/assets/chunk.143.29de83d81f2618619098.js:2:1782)
    at a.exports (https://rwwagner90.github.io/ember-shepherd/assets/vendor-56be03bdc2aa34cb191a44c52d4560b2.js:20:21)
    at requireModule (https://rwwagner90.github.io/ember-shepherd/assets/vendor-56be03bdc2aa34cb191a44c52d4560b2.js:7:106)
    at e.exports.window.emberAutoImportDynamic (https://rwwagner90.github.io/ember-shepherd/assets/chunk.143.29de83d81f2618619098.js:2:100)
    at c._initialize (https://rwwagner90.github.io/ember-shepherd/assets/vendor-56be03bdc2aa34cb191a44c52d4560b2.js:7063:57)
    at c.addSteps (https://rwwagner90.github.io/ember-shepherd/assets/vendor-56be03bdc2aa34cb191a44c52d4560b2.js:7059:469)
(anonymous) @ vendor-56be03bdc2aa34cb191a44c52d4560b2.js:1159
buttons:1 Uncaught (in promise) ChunkLoadError: Loading chunk 574 failed.
(error: https://rwwagner90.github.io/ember-shepherd/docs/api/modules/ember-shepherd/utils/ADDON_DOCS_ROOT_URL/assets/chunk.574.55dd52836b50b236133f.js)
    at o.f.j (chunk.143.29de83d81f2618619098.js:37:20)
    at chunk.143.29de83d81f2618619098.js:24:190
    at Array.reduce (<anonymous>)
    at o.e (chunk.143.29de83d81f2618619098.js:24:168)
    at a.callback (chunk.143.29de83d81f2618619098.js:2:1782)
    at a.exports (vendor-56be03bdc2aa34cb191a44c52d4560b2.js:20:21)
    at requireModule (vendor-56be03bdc2aa34cb191a44c52d4560b2.js:7:106)
    at e.exports.window.emberAutoImportDynamic (chunk.143.29de83d81f2618619098.js:2:100)
    at c._initialize (vendor-56be03bdc2aa34cb191a44c52d4560b2.js:7063:57)
    at c.addSteps (vendor-56be03bdc2aa34cb191a44c52d4560b2.js:7059:469)

Thanks for the addon, anyways! Will try to adapt it in some existing apps of ours.

@RobbieTheWagner
Copy link
Member

@derrabauke I am seeing the same issue. Embroider does not like me 😅

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

4 participants