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 2 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 an empty object (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: 1e96906

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
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.

None yet

1 participant