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

Fix crash on certain versions of Tizen and Samsung Internet #11148

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from

Conversation

tacheometry
Copy link

@tacheometry tacheometry commented Dec 27, 2023

Issue description

A friend was having issues with Jellyfin on his Samsung Smart TV. Running the program, the following stack trace displayed:

TypeError: Failed to construct 'Headers': No matching constructor signature.

It reads out: TypeError: Failed to construct 'Headers': No matching constructor signature.

Tracking this down, it is due to some react-router code. Turns out, this is due to a bug in Samsung's JavaScript implementation. new Headers(undefined) should be a valid constructor, but running this on Samsung, this errors. I suggested updating the browser, but this was not possible, as the version was locked.

Fix

Thus, like in other projects I've seen, I've implemented the fix of running the constructor with no parameters (new Headers()) instead of undefined or null (new Headers(undefined)).

This is inspired from the following work:

These changes increase compatibility, making it possible to run react-router on older browser implementations, and introduce no breaking changes.

After building using this fork of React Router, the program was no longer crashing on my friend's Tizen system.

Copy link

changeset-bot bot commented Dec 27, 2023

🦋 Changeset detected

Latest commit: 8d9ec2a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 5 packages
Name Type
@remix-run/router Patch
react-router Patch
react-router-dom Patch
react-router-dom-v5-compat Patch
react-router-native Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@tacheometry tacheometry changed the title Fix Headers constructor with undefined Fix crash on certain versions of Tizen and Samsung Internet Dec 27, 2023
@CLEMENTINATOR
Copy link

@tacheometry This issue is getting more attention since the jellyfin 10.9.x release. Is there any way you can fix the CI issue, repush and notify the maintainer ?
Best regards

@remix-cla-bot
Copy link
Contributor

remix-cla-bot bot commented May 18, 2024

Thank you for signing the Contributor License Agreement. Let's get this merged! 🥳

@tacheometry
Copy link
Author

Should be good to go @CLEMENTINATOR

@tacheometry
Copy link
Author

Regarding getting more attention on this, engagement from affected users might help

@newo-2001
Copy link

In that case I'll just mention that I am affected by this as well.

@dmitrylyzo
Copy link

webOS 4 (at least the emulator) has the same bug.

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

Successfully merging this pull request may close these issues.

4 participants