Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/thin-suns-fail.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@sveltejs/kit': patch
---

fix: correctly resolve `$app/state` on the server with Vite 5
8 changes: 7 additions & 1 deletion packages/kit/src/exports/vite/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,13 @@ async function kit({ svelte_config }) {
// See https://github.com/sveltejs/kit/pull/9172
// and https://vitest.dev/config/#deps-registernodeloader
'@sveltejs/kit'
]
],
resolve: {
// We need this so that importing $app/state correctly
// resolves to the default conditional export instead of
// the browser condition on the server.
conditions: ['module', 'node']
}
}
};

Expand Down
Loading