Handle Turbo Stream responses
mainRequest.JS automatically processes Turbo Stream responses. To ensure this works, you must ensure the window.Turbo global variable is set. If you are using @hotwired/turbo-rails version 7.0.0-beta.6 or later, this is handled automatically. Otherwise, set it manually:
import { Turbo } from "@hotwired/turbo-rails"
window.Turbo = TurboRequest.JS also uses Turbo's fetch to include the X-Turbo-Request-ID header.
import { Turbo } from "@hotwired/turbo-rails"
window.Turbo = Turbo