Skip to content

acurrieclark/vite-ssr-error

Repository files navigation

SvelteKit Vite 4.2 SSR error

With Vite 4.2

npm i
npm run dev

An Internal server error: window is not defined error is thrown.

With Vite 4.1

Replace the vite version in package.json with 4.1.4 (the last release before 4.2.0) and repeat the above steps. The site will load without issue.

Notes

I realise that this is perhaps a little niche, and I am not enitrely sure where in the chain this issue will exist, but this doesn't strike me as correct behaviour.

The guard against rendering anything on the server is deliberate for a specific use case I have for Safari. I only need to SSR in dev because of this issue: sveltejs/kit#7805.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages