Help us help you! Please choose one:
react-rails, so I've included the stack trace and the exact steps which make it crash.react-rails with another library, but I'm having trouble. I've described my JavaScript management setup (eg, Sprockets, Webpack...), how I'm trying to use this other library, and why it's not working.I've tried this in a large react-rails app that I've been trying to upgrade to 2.0 as well as a fresh app, neither of which includes turbolinks. I was attempting to debug why ReactRailsUJS.mountComponents() doesn't seem to be running automatically, which is what led me to attempt to call ReactRailsUJS.detectEvents(). I do not see any errors in the console when my page loads, only after calling detectEvents().
> ReactRailsUJS.detectEvents()
detect.js?5263:12 Uncaught ReferenceError: Turbolinks is not defined
at module.exports (eval at <anonymous> (application.js:3324), <anonymous>:12:5)
at Object.detectEvents (eval at <anonymous> (application.js:3313), <anonymous>:114:5)
at <anonymous>:1:15
Same issue here, can it be used without Turbolinks? Our app extensively use react-router, that conflicts with Turbolinks, would go for disabling the latter, but breaks page loading. We're calling mountComponents() manually as well, but nothing happens
Thanks
It looks like _this_ line is causing the error, right?
Maybe the file should be update to something like
if (typeof Turbolinks !== "undefined" && ...)
?
Can we make a PR on this? @reactjs
@rmosolgo Can you give me permission on NPM please?
Not sure what you need to grant me publish, but my account is: https://www.npmjs.com/~bookofgreg
I'll push this out as part of 2.3.1 I think.
Thanks.
Very cool :) I added you as a collaborator, I think that should do it! https://www.npmjs.com/package/react_ujs
Most helpful comment
It looks like _this_ line is causing the error, right?
https://github.com/reactjs/react-rails/blob/b39860b69b4c0eb5612169df0c5d8208e7d598dd/react_ujs/src/events/detect.js#L12
Maybe the file should be update to something like
?