russelldmatt / svelte-custom-store-weirdness

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

A minimal reproduction of an issue with custom svelte stores

To reproduce:

npm install
npm run build

You should see output that looks like this:

{ a: Set(0) {} }
{ b: undefined }
{ c: Set(0) {} }
{ d: Set(0) {} }

The fact that b is undefined is the bug!

A very confusing way to "fix" the bug

Now go into +page.svelte and delete lang="ts" from the script tag.

Run npm run build again and...

{ a: Set(0) {} }
{ b: Set(0) {} }
{ c: Set(0) {} }
{ d: Set(0) {} }

🤯

About


Languages

Language:Svelte 43.7%Language:JavaScript 41.6%Language:HTML 13.4%Language:TypeScript 1.3%