But in my browser, Firefox, it always complains as it is looking for the long bundled awkward name for things, and it never finds that. So I get an error all the time in my console looking something like this:
Is there a way to clean this up? It seems like there is a missing step somewhere, and I am not smart enough to figure it out. I can delete the --sourcemap directive and remove the application.js.map from my builds completely, and I care not… but I am sure for debugging purposes, that might be a dumb idea.
Interesting point! App has no view helpers. The one gem I use that does affect views, I checked, and nothing jumps out as rendering anything to do with the build assets.
After recently switching to jsbundling-rails I could not get sourceMaps to work and filed this issue (not sure if it is the same issue you are facing):
At first glance it looked related to Sprockets, so I thought I could try Propshaft instead, but our app has a dependency currently incompatible with it (and anyway Propshaft is still alpha).
At least I know I am not the only one! This sat for weeks on StackOverflow with no one understanding my question, but now it is nicely narrowed down to using Sprockets and ESBuild.
You need to remove that line(option) in order to get the maps working. Probably you have upgraded rails 6 app to esbuild. If that line stays Rails will look for the maps in the wrong place(“old” sprockets source maps). This is why new rails 7 app does’t have that line
Our Rails 7 app does not have config.assets.debug defined, and yet the source maps directive at the end of the JS bundle file does not survive after going through sprockets (even though it is present in the esbuild generated file). (See issue for details.)