2.22.3: issues with redirect
#13976
redirectDevelopment PR
This was an accidental removal in #13971, we still need it: Without this SvelteKit will be prebundled on the client, which means we end up with two versions of Redirect etc. Also see #5952 (comment)
No test because it's only testeable when SvelteKit is resolved as a npm package, Vite seems to do resolving slightly different within a monorepo
Fixes #13976
Issue
From "@sveltejs/kit": "2.22.3" if I use this code in +layout.ts:
export const load: LayoutLoad = ({ url }) => {
if (some logic) {
// other logic
redirect(302, redirect_url);
}
// other code
};
I get this error that I do not understand:
Everything is working fine with 2.22.2.
Reproduction
Severity
blocking all usage of SvelteKit
Info
The most likely explanation is that you're bundling multiple copies of SvelteKit somehow, though without a repro it'll be very hard to diagnose
I'm using pnpm dedupe after each pnpm install.
I'll create a repro very soon!
I added the reproduction: .
Pro tip: You can prefix GitHub URLs of issues, PRs or discussions with svcl.dev/ to view them on this page! Also try it on a GitHub release ;)