Ask A Question

Notifications

You’re not receiving notifications from this thread.

Webpack trying to serve incorrect files

Keith Thibodeaux asked in Rails

I am using new relic with my app, and it seems there are often 404s that show up. The file it is trying to load is an older packs/js/application-blah.js, sometimes one revision old, sometimes the very first revision (10+ deploys and weeks ago). This started happening (I think) when upgrading to webpacker 4 from 3.5.

Over a 12 hour period I saw 10 errors for the 404, and served an average of 40 pages per minute during the time frame, so it is decently rare and I can't reproduce it. It does not seem to be OS or browser specific, I'm seeing it on everything from Edge on Windows to Safari on iOS 12.

Also seems to be trying to bring in a file from packs/, which I don't think should exist anymore with webpacker 4?

This is an excerpt what I see in New Relic:

No route matches [GET] "/packs/js/application-1a5742633d44555a15cf.js"
No route matches [GET] "/packs/application-b8e132938408ef6c4ee9.js"

This is what packs/manifest.json looks like:

{
 "application.js": "/packs/js/application-63945be2fec97ef46418.js",
 "application.js.map": "/packs/js/application-63945be2fec97ef46418.js.map",
 "entrypoints": {
   "application": {
     "js": [
       "/packs/js/application-63945be2fec97ef46418.js"
     ],
     "js.map": [
       "/packs/js/application-63945be2fec97ef46418.js.map"
     ]
   }
 }
}

The errors show up for a day or two after a deploy, but did not show up this past weekend (no deploys on Friday), so it makes me think it is a caching issue. The b8e... it is trying to load has always been the same though, that never changes.

If anyone has any insight to offer I would be greatly appreciative!

Reply

I am getting something similar to this when I added dropzone js. I haven't found a solution yet. Have you already solved this?

Reply
Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 87,400+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.