-
Notifications
You must be signed in to change notification settings - Fork 429
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"the name "turbo-frame" has already been used with this registry" #104
Comments
I'm getting the same error when switching between layouts. I have one A fix is to mark the links and forms which cause the switch of layout with |
This happens when Turbo is being loaded twice. Are you sure you didn't also include the turbo_include_tags call? That call is not to be used if you're using webpack. |
@dhh In the meantime I found the issue. I forgot to change |
I don't think that's my issue, but I could be wrong. I don't think I have I have this
The error comes loading the second pack, take away the second line it's fine. I even get the error if the second pack is empty. I'm fully prepared to believe that I'm missing something obvious... Or that it's a webpacker issue? |
Turbo doesn't seem to protect its core from loading twice. I ran into this issue just now with Webpack and extracting a common bundle, which was being loaded twice on navigation, resulting in this error. For now I've worked around by wrapping the Turbo loader like:
Turbo is calling |
So for me this was caused because I wasn't loading the JS that imported |
This also happens when you receive a 404 page that does not contain the js scripts and then you hit browser back button. Using with laravel. |
I encountered this error because I'm using My solution was a factory function that tracks and returns a single instance of Turbo it loads via require. - import Turbo from '@hotwired/turbo'
-
- Turbo.start()
+ export const getTurbo = async () => {
+ if (!window.Turbo) {
+ const Turbo = require('@hotwired/turbo')
+ await Turbo.start()
+ window.Turbo = Turbo
+ }
+
+ return window.Turbo
+ } Using |
I had same issue for few days.
When I checked if I have more than one
Also for
I uninstalled all of them as well as |
@alexnj i dont understand what the point of this export even is here Line 6 in f9d1651
which immediately calls Line 7 in f9d1651
Calling Line 38 in f9d1651
And then if you look at https://github.com/hotwired/turbo-rails/blob/main/app/javascript/turbo/index.js#L1 Which has this global define
Is there anyway i can control the initialization that doesn't involve the absence of an import? I'm trying to avoid a separate entrypacks? |
It seems like the latest webpakcer supports badly multiple packs tags on the layout: rails/webpacker#2932 So instead of having:
It should be
|
if (!window.Turbo) {
require("@hotwired/turbo-rails")
} |
Using Turbo in a Rails app, latest beta of
turbo-rails
andwebpacker
.On adding a second pack to my application and referencing it via
javascript_packs_with_chunks_tag
, I got the following error in console, even though the second pack does not loadturbo-rails
. Removing the second pack reference removes the error.This happens even if the second pack file is empty.
The text was updated successfully, but these errors were encountered: