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

Crash when // is used as Link's to #5440

Closed
1 task done
rpominov opened this issue Feb 13, 2023 · 5 comments
Closed
1 task done

Crash when // is used as Link's to #5440

rpominov opened this issue Feb 13, 2023 · 5 comments
Labels
bug Something isn't working

Comments

@rpominov
Copy link

rpominov commented Feb 13, 2023

What version of Remix are you using?

1.12.0

Are all your remix dependencies & dev-dependencies using the same version?

  • Yes

Steps to Reproduce

  1. Add this code to a page <Link to="//">...</Link>
  2. Open the page in the browser

Same problem with some other values of to for example "http://", so I think this should be fixed by wrapping new URL() into a try..catch rather than checking for known fail cases.

Expected Behavior

Page doesn't crash, instead <a href="//">...</a> is rendered

Actual Behavior

The page crashes with a error Failed to construct 'URL': Invalid URL

Screenshot 2023-02-13 at 15 08 14

@rpominov
Copy link
Author

To give more context:

We at @webstudio-is have a case where the to value comes from user input. We would like to just have a link that doesn't work in this case instead of entire app crushing.

@krall12
Copy link

krall12 commented Feb 13, 2023

This sounds related to a bug I had filed a few months ago #4422

Looks like they have it fixed for an upcoming version.

@brophdawg11 brophdawg11 self-assigned this Feb 15, 2023
@github-actions
Copy link
Contributor

This issue has been automatically marked stale because we haven't received a response from the original author in a while 🙈. This automation helps keep the issue tracker clean from issues that are not actionable. Please reach out if you have more information for us or you think this issue shouldn't be closed! 🙂 If you don't do so within 7 days, this issue will be automatically closed.

@github-actions github-actions bot added the needs-response We need a response from the original author about this issue/PR label Apr 17, 2023
@brophdawg11 brophdawg11 added bug Something isn't working awaiting release This issue has been fixed and will be released soon and removed needs-response We need a response from the original author about this issue/PR bug:unverified labels Apr 18, 2023
@brophdawg11 brophdawg11 removed their assignment Apr 21, 2023
@brophdawg11
Copy link
Contributor

This is fixed by remix-run/react-router#10367 and will be available once Remix 1.16.0 is released.

@rpominov
Copy link
Author

Great work! Thank you!

@brophdawg11 brophdawg11 removed the awaiting release This issue has been fixed and will be released soon label Dec 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants