Skip to content
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

Redundant customElements definition for Web Component 'turbo-cable-stream-source' causes error in some clients #409

Closed
riffdr opened this issue Dec 9, 2022 · 2 comments

Comments

@riffdr
Copy link
Contributor

riffdr commented Dec 9, 2022

This


customElements.define("turbo-cable-stream-source", TurboCableStreamSourceElement);

Should be wrapped within an undefined check like the rest of the turbo custom elements. It randomly throws errors on the client that are being reported by Sentry from our Rails application. Can someone take care of this, or may we open a pull request?



if (customElements.get("turbo-frame") === undefined) {
  customElements.define("turbo-frame", FrameElement);
}

if (customElements.get("turbo-stream") === undefined) {
  customElements.define("turbo-stream", StreamElement);
}

if (customElements.get("turbo-stream-source") === undefined) {
  customElements.define("turbo-stream-source", StreamSourceElement);
}
@dhh
Copy link
Member

dhh commented Dec 9, 2022

cc @seanpdoyle

@dhh
Copy link
Member

dhh commented Jan 3, 2023

Fixed via #410.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants