-
Notifications
You must be signed in to change notification settings - Fork 152
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
Sourcemaps with esbuild not working. #73
Comments
@ioev I had this too, but digging around other |
For others, you must set |
This fix in conjunction with: allows the sourcemaps to be located, but they still don't seem to actually work in the browser. I also tried
(Rails 6.1.4.1 and Sprockets 4.0.2/Sprockets-rails 3.4.2 btw) |
You need to using sprockets-rails 3.4.2+ for this to work. |
This was outputting an `application.debug-[fingerprint].js` file, which was causing a lot of confusion. [This issue](rails/jsbundling-rails#73) had the solution for why it was happening. I don't think there's much benefit to outputting the `.debug` file if we're going to minify the JS (coming in the next commit), so I've turned it off.
This was outputting an `application.debug-[fingerprint].js` file, which was causing a lot of confusion. [This issue](rails/jsbundling-rails#73) had the solution for why it was happening. I don't think there's much benefit to outputting the `.debug` file if we're going to minify the JS (coming in the next commit), so I've turned it off.
I'm actually not sure if this is a problem with jsbundling-rails or bundler, but:
I'm bundling my js/css via
esbuild --bundle --watch --sourcemap
which results in 2 files being generated in assets/builds, application.js and application.js.map. The application requests these via:/assets/application.debug-1caabe86ba2a00618598d8d7d5a8fe6c57a594dd7babeec3fe6e3ff3ce9185e1.js
/assets/application.js-4112a73edf43c31165109b2906c7bcda25ff0505d405213d39501087ea154f74.map
The sourcemap url does not exist.
If I look at the bottom of my application.js in the build folder, it ends with:
And if I look at the end of the file coming from a server request, it ends with:
The first source map url works, the second does not. I'm assuming bundler is somehow fixing the existing sourcemap definition, but then also adding it's own?
Running esbuild without --sourcemaps ends up with sourcemaps that work on the client, but they are not useful.
Is there a workflow that will work here?
The text was updated successfully, but these errors were encountered: