Ask A Question

Notifications

You’re not receiving notifications from this thread.

Javascript not working in production

Beavidy asked in Rails

I am using Rails 7 with importmap, everything works fine in development, but in production none of the javascript works. Specifically, my channels files are of the "wrong MIME type" giving a 404, and none of my bootstrap dropdowns work. I haven't even tried the rest, but I'm assuming there is something silly I'm missing and everything will fall into place once i correct that. I've tried clobbering, precompiling, changed relative paths to direct paths. I'm at a loss. Any help is greatly appreciated!

Reply

How are you deploying your app?

Reply

I'm using Heroku. But now I'm just trying to get it up and running locally in production before trying to deploy again.

Reply

Hmm. Are you using import maps for these? How are you referencing the files?

Reply

importmaps

Reply

So you are a Ruby Rails Developer? How many years of experience do you have in this sector?

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.