Ask A Question

Notifications

You’re not receiving notifications from this thread.

How to troubleshoot esbuild in Rails 7

Vorkosigan76 asked in Rails

With the arrival of Rails 7.0, i have tried moving from webpack to esbuild but struggle with it.

I know that theoretically, creating a file jquery.js and importing it in application.js
import jquery from “jquery”
window.jQuery = jquery window.$ = jquery

Should make $ available in the views… but sometimes it doesn't but i have no idea why (even if esbuild compiles successfully) Any idea how to troubleshoot this?

I have noticed for example that I need to put a carriage return after the last line in jquery.js... if I don't, I dont have any error message in the console the the .map is not generated

Reply
Join the discussion
Create an account Log in

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

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

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