Skip to content

Commit 02bd767

Browse files
authored
docs: tell people to avoid goto(external)
related to #8775
1 parent fa31965 commit 02bd767

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

.changeset/loud-pans-fly.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@sveltejs/kit': patch
3+
---
4+
5+
docs: discourage use of `goto` with external URLs

packages/kit/types/ambient.d.ts

+1
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ declare module '$app/navigation' {
170170
export function disableScrollHandling(): void;
171171
/**
172172
* Returns a Promise that resolves when SvelteKit navigates (or fails to navigate, in which case the promise rejects) to the specified `url`.
173+
* For external URLs, use `window.location = url` instead of calling `goto(url)`.
173174
*
174175
* @param url Where to navigate to. Note that if you've set [`config.kit.paths.base`](https://kit.svelte.dev/docs/configuration#paths) and the URL is root-relative, you need to prepend the base path if you want to navigate within the app.
175176
* @param opts Options related to the navigation

0 commit comments

Comments
 (0)