-
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
404 causes DOMException #188
Comments
I'm having the same problem using 7.0.0-beta.4 configured with Webpack in ASP.NET Core. Response with 404 and 500 status code seems to reload turbo. |
This looks to be related to #104 and a similar issue from Turbolinks: turbolinks/turbolinks#179 Essentially Turbo handles 404/500 pages differently, and ends up re-rendering the page and initializing itself twice which leads to these errors. Unfortunately, the monkey patch from the issue above doesn't work on Turbo (or I can't get it to work at least) |
I opened hotwired/turbo-rails#249 as this seems to be more of an issue with turbo-rails than Turbo, and the specific use case we're able to replicate on is using a custom error controller that has the same layout as our main application which includes turbo. Because the ErrorRender in Turbo reloads both the body and head, it leads to turbo-rails and turbo being initialized twice. It seems that Turbo is protected from this (here), but turbo-rails is not. |
Same problem with 7.0.1 |
I am seeing the same issue in a non-Rails setup |
I fixed this with
|
This one is indeed a showstopper for anything handling 4xx and 5xx errors. As @clinejj observed above, the monkey patch didn't work and it'll never work with Turbo. It turns out that HttpRequest class was removed altogether. But rather than what he also pointed out, it's not only turbo-rails related. Also, it's not limited to It would be really nice from Turbo devs if they could elaborate a bit on the reasoning behind HttpRequest removal. It would be even nicer from their part if a workaround could be provided... It doesn't even need to be funcional code tho. A shallow overview would suffice for devs like us to figure out the rest. |
I'm having the same problem with After changing
from index.js to
The problem is gone, but the 404 page would flash a bit, not as smooth as normal pages. |
This is discussed in detail several places, e.g: hotwired#188 (comment)
This is discussed in detail several places, e.g: hotwired#188 (comment)
This is discussed in detail several places, e.g: hotwired#188 (comment)
This is discussed in detail several places, e.g: hotwired#188 (comment)
This is discussed in detail several places, e.g: hotwired#188 (comment)
This is discussed in detail several places, e.g: hotwired#188 (comment)
This is discussed in detail several places, e.g: hotwired#188 (comment)
This is discussed in detail several places, e.g: hotwired#188 (comment)
I'm using the latest version of Turbo (beta 4 at the time of writing) and I've noticed that when you hit a 404 page it causes the following error in the console:
This only happens when hitting a 404 from another link... if you refresh the non existent page the error doesn't happen.
The text was updated successfully, but these errors were encountered: