enyo / context-issue

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Test context-issue

See the issue:

git clone https://github.com/enyo/context-issue.git
cd context-issue/svelte-kit-app
npm install
npm run dev

This will fail with:

Function called outside component initialization

As you can see, the imported library only uses setContext() in the top level function.

Fix

Change the import in src/routes/index.svelte to a relative import and it works again.

About


Languages

Language:JavaScript 51.9%Language:Svelte 21.8%Language:HTML 19.4%Language:TypeScript 6.9%