Open
Description
Describe the bug
// src/routs/a/+page.ts
import { redirect } from '@sveltejs/kit';
export const load = () => {
redirect(302, '/b');
};
// src/routs/+page.svelte
<button
onclick={async () => {
await goto('/a');
console.log(page.url.pathname); // /
await tick();
console.log(page.url.pathname); // /
await new Promise((r) => setTimeout(r, 1000));
console.log(page.url.pathname); // /b
}}>goto a</button
>
Reproduction
System Info
System:
OS: Linux 5.0 undefined
CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
Memory: 0 Bytes / 0 Bytes
Shell: 1.0 - /bin/jsh
Binaries:
Node: 18.20.3 - /usr/local/bin/node
Yarn: 1.22.19 - /usr/local/bin/yarn
npm: 10.2.3 - /usr/local/bin/npm
pnpm: 8.15.6 - /usr/local/bin/pnpm
npmPackages:
@sveltejs/adapter-auto: ^4.0.0 => 4.0.0
@sveltejs/kit: ^2.16.0 => 2.17.1
@sveltejs/vite-plugin-svelte: ^5.0.0 => 5.0.3
svelte: ^5.0.0 => 5.19.9
vite: ^6.0.0 => 6.1.0
Severity
serious, but I can work around it
Additional Information
No response