ruby-on-railshotwire-railsturbo-rails

Turbo-rails not functioning in production


My app:

In development, everything behaves as expected, but in production (Ubuntu 22.04) NOTHING turbo-related seems to work:

I realize that this question is vague but I would greatly appreciate pointers, where should I look, what steps I might take to diagnose the problem.

Thanks!

UPDATE

Thanks to newcomer Ivan, it occurred to me that I had failed to take the obvious step to check the browser's console for errors.

I found and fixed a bug (obviously different from Ivan's) in a small Stimulus.js controller and now Turbo is again doing its thing.

I do apologize for wasting people's time but hope that this exchange may serve some purpose, a reminder to do your homework before asking for help.

Cheers


Solution

  • Met the same issue, and solved it! in my case it was not turbo`s fault, but just another problem. What you should do: Go on your site in production, then to browser console, there should be errors, which must be fixed to site works. in my case it was (picture of my browser console) file not found 404, due wrong path to file in index.js. I solved my problem by changing

    import SortableController from './sortable_controller'
    

    to

    import SortableController from 'controllers/sortable_controller'
    

    i fount solution to it here: https://github.com/rails/importmap-rails/issues/55