-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Closed
Labels
bugSomething isn't workingSomething isn't workingp1-importantSvelteKit cannot be used by a large number of people, basic functionality is missing, etc.SvelteKit cannot be used by a large number of people, basic functionality is missing, etc.
Milestone
Description
Describe the bug
There appears to be no way to use the new redirect method and disable SSR globally.
Reproduction
- Create a new skeleton project
- Create
src/routes/page.tswith the contents:
import { redirect } from "@sveltejs/kit";
export function load() {
throw redirect(307, "/about")
}- Create
src/hooks.tswith the contents:
import type { Handle } from '@sveltejs/kit'
export const handle: Handle = async ({ event, resolve }) => {
return resolve(event, { ssr: false })
}- Navigating to root now results in an error page, with the redirect class passed to it, instead of being redirected to "/about"
Repo: https://github.com/WaltzingPenguin/sveltekit-redirect-hooks
Logs
No response
System Info
System:
OS: Windows 10 10.0.19043
CPU: (12) x64 AMD Ryzen 5 1600 Six-Core Processor
Memory: 7.50 GB / 15.95 GB
Binaries:
Node: 16.15.0 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.10 - ~\AppData\Roaming\npm\yarn.CMD
npm: 7.20.3 - C:\Program Files\nodejs\npm.CMD
Browsers:
Chrome: 104.0.5112.81
Edge: Spartan (44.19041.1266.0), Chromium (104.0.1293.54)
Internet Explorer: 11.0.19041.1566
npmPackages:
@sveltejs/adapter-auto: next => 1.0.0-next.64
@sveltejs/kit: next => 1.0.0-next.413
svelte: ^3.44.0 => 3.49.0
vite: ^3.0.0 => 3.0.8Severity
blocking an upgrade
Additional Information
No response
aloker, trmcnvn, fev4, moisesbites, madeleineostoja and 16 moreemmnull
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingp1-importantSvelteKit cannot be used by a large number of people, basic functionality is missing, etc.SvelteKit cannot be used by a large number of people, basic functionality is missing, etc.