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

[Bug]: React router doesn't handle 'content://' URLs #11452

Open
Wardevour opened this issue Apr 15, 2024 · 0 comments
Open

[Bug]: React router doesn't handle 'content://' URLs #11452

Wardevour opened this issue Apr 15, 2024 · 0 comments
Labels

Comments

@Wardevour
Copy link

Wardevour commented Apr 15, 2024

What version of React Router are you using?

6.22.3

Steps to Reproduce

Create a React project with Vite
Install react-router-dom
Implement a HashRouter in main.jsx
Build an HTML file with npm run build (tested with vite-plugin-singlefile to create a single HTML file)
Transfer HTML file to a mobile device
Open the HTML file with Chrome using a file browser app (Files on Android for example)

Expected Behavior

The application should not have any unexpected JavaScript errors and behave the same as when opening the file with a desktop PC

Actual Behavior

return new URL(href, base);

The line above throws an Error because URL's constructor has 'base' set to a URL that begins with 'content://', which doesn't seem to be supported in Chromium based browsers

@Wardevour Wardevour added the bug label Apr 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant