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/cuddly-melons-taste.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@sveltejs/kit': patch
---

fix: allow whitespace in legacy onMount check
2 changes: 1 addition & 1 deletion packages/kit/src/runtime/client/state.svelte.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export let updated;

// this is a bootleg way to tell if we're in old svelte or new svelte
const is_legacy =
onMount.toString().includes('$$') || /function \w+\(\) \{\}/.test(onMount.toString());
onMount.toString().includes('$$') || /function \w+\(\) \{\s?\}/.test(onMount.toString());

if (is_legacy) {
page = {
Expand Down
Loading