You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 25, 2021. It is now read-only.
When I'm developing, Turbolinks works fine. The Turbolinks JavaScript object is available in my JavaScript console as expected.
When I deploy to production, the Turbolinks object isn't defined properly. The Turbolinks object isn't available in the JavaScript console, and my site does full page loads instead of Turbolinks page loads.
Upon further inspection of my production environment, the application.js asset is getting compiled and served. jQuery is accessible. Turbolinks appears in the minified JavaScript:
To me, it seems like Turbolinks is properly setup, but after going through asset compilation for the production environment it's not available in the window for usage.
# Compress JavaScripts and CSS.config.assets.js_compressor=:uglifier# config.assets.css_compressor = :sass# `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb# Enable serving of images, stylesheets, and JavaScripts from an asset server.# config.action_controller.asset_host = 'http://assets.example.com'
FWIW I'm deploying on Heroku and relying on them to do asset precompilation, and using the rails_12factor gem. To me it seems like Turbolinks is included correctly in the asset pipeline, but the Turbolinks JavaScript is somehow getting mangled by the precompliation/minification process.
Thanks for all the hard work you put into Turbolinks. My team is extremely excited about it.
–Ben
The text was updated successfully, but these errors were encountered:
@sunsheeppoplar I was able to get Turbolinks 5 working on Heroku, but I'm not sure what exactly what got me past this issue. I'm sorry, I know that's not helpful. ☹️ I'm pretty sure it was something with my Rails app, not Heroku. I don't remember reconfiguring Heroku in any special way.
One think you might try is to clear public/assets directory. I've had similarly weird JS issues before when I accidentally compiled assets in public/assets locally and dev was using compiled assets unbeknownst to me.
I'm sorry I can't be more help. Maybe somebody else will find this and understand that the issue is.
@aguynamedben That's no problem at all. It turned out the reason our Turbolinks object wasn't available was because we had, of course (duh), minified our script. Our problem ended up being something else (that Bootstrap had a dependency, Tether, that wasn't available for some reason). Thanks for responding!
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
When I'm developing, Turbolinks works fine. The Turbolinks JavaScript object is available in my JavaScript console as expected.
When I deploy to production, the Turbolinks object isn't defined properly. The Turbolinks object isn't available in the JavaScript console, and my site does full page loads instead of Turbolinks page loads.
Upon further inspection of my production environment, the application.js asset is getting compiled and served. jQuery is accessible. Turbolinks appears in the minified JavaScript:
My application.js:
To me, it seems like Turbolinks is properly setup, but after going through asset compilation for the production environment it's not available in the window for usage.
Gemfile.lock
config/environments/production.rb
FWIW I'm deploying on Heroku and relying on them to do asset precompilation, and using the rails_12factor gem. To me it seems like Turbolinks is included correctly in the asset pipeline, but the Turbolinks JavaScript is somehow getting mangled by the precompliation/minification process.
Thanks for all the hard work you put into Turbolinks. My team is extremely excited about it.
–Ben
The text was updated successfully, but these errors were encountered: