Skip to content

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

@rpominov

Description

@rpominov

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions