Skip to content

detectEvents() results in Turbolinks is not defined #743

Closed
@swrobel

Description

@swrobel

Help us help you! Please choose one:

  • My app crashes with react-rails, so I've included the stack trace and the exact steps which make it crash.
  • My app doesn't crash, but I'm getting unexpected behavior. So, I've described the unexpected behavior and suggested a new behavior.
  • I'm trying to use 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 have another issue to discuss.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions