question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

404 causes DOMException

See original GitHub issue

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:

Uncaught DOMException: Failed to execute 'define' on 'CustomElementRegistry': the name "turbo-frame" has already been used with this registry

This only happens when hitting a 404 from another link… if you refresh the non existent page the error doesn’t happen.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:10
  • Comments:9

github_iconTop GitHub Comments

4reactions
kmmbvnrcommented, Nov 2, 2021

I fixed this with data-turbo-eval="false" on the script tag with turbo bundle

<script src="{% static 'viewflow/js/turbo.es5-umd.js' %}" data-turbo-eval="false"></script>
2reactions
clinejjcommented, May 6, 2021

This looks to be related to #104 and a similar issue from Turbolinks: https://github.com/turbolinks/turbolinks/issues/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)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error 404: 4 Ways to Fix It - Hostinger
Error 404 is a response code, meaning the server could not locate the requested content. Check this article to learn 4 steps to...
Read more >
404 error when trying to register serviceWorker - Stack Overflow
I get this error when trying to register the service worker: Failed to register a ServiceWorker: A bad HTTP response code (404) was...
Read more >
DOMException - Web APIs | MDN
A request was placed against a transaction that is currently not active or is finished (No legacy code value and constant name). ReadOnlyError ......
Read more >
Error 404 not found - What does it mean & how to fix it! - IONOS
The typical trigger for an error 404 message is when website content has been removed or moved to another URL. There are also...
Read more >
Common Errors - PouchDB
PouchDB throws 404 (Object Not Found) for '_local' document ... javascript file to the unminified one, since code comments can also cause parse...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found