I’m attempting something similar to the filtering in the boring rails better stimulus controllers, but whenever I go to use:
Turbo.visit(*** path in here ***)
I get this error:
TypeError: _hotwired_turbo__WEBPACK_IMPORTED_MODULE_0__.default is undefined
I originally had the hotwire-rails gem installed but I’ve fallen back to installing stimulus and turbo via yarn and using webpack(er). Stimulus works just fine, and turbo frames work just fine but I just can’t programmatically call out to Turbo in my JS.
import Turbo from "@hotwired/turbo"
import { Controller } from "stimulus";
import { debounce } from "lodash";
import Rails from "@rails/ujs";
export default class extends Controller {
static targets = ["filter", "profiles"];
// Other irrelevant JS stuff is in this file, but I've eliminated everything to be just a simple click to run this function and then call to Turbo.visit()
filter() {
Turbo.visit();
}
}
I tried to include everything relevant, but please let me know if there is an additional files or context that would help out with troubleshooting.