fix: re-add @sveltejs/kit to optimizeDeps.exclude
#13983
@sveltejs/kit to optimizeDeps.excludeClosing 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
https://stackblitz.com/edit/sveltejs-kit-template-default-tbzr2tku
Severity
blocking all usage of SvelteKit
Pull request
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
Info
🦋 Changeset detected
Latest commit: af1a604
The changes in this PR will be included in the next version bump.
This PR includes changesets to release 1 package
| Name | Type |
|---|---|
| @sveltejs/kit | Patch |
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this 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 https://github.com/sveltejs/kit/issues/5952#issuecomment-1218844057 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
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 ;)