Skip to content

goto should error if called with an external route #14285

@Rich-Harris

Description

@Rich-Harris

Describe the problem

If you do this...

await goto('https://elsewhere.com');

...you get an error:

Cannot use goto with an external URL. Use window.location = "https://elsewhere.com/" instead

But goto('/non-existent-route') doesn't error.

Describe the proposed solution

Make it behave consistently

Alternatives considered

No response

Importance

nice to have

Additional Information

#13303 (comment)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions