Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[HELP] Error: Function called outside component initialization #38

Open
psociety opened this issue Oct 27, 2022 · 0 comments
Open

[HELP] Error: Function called outside component initialization #38

psociety opened this issue Oct 27, 2022 · 0 comments

Comments

@psociety
Copy link

psociety commented Oct 27, 2022

Hi!
Thank you for creating SSWR!

I'm getting Error: Function called outside component initialization but i can't understand why.
SSWR is called inside onMount.
onMount -> wrapper method -> SSWR.

Error trace:
image

Where it starts:
image

Wrapper method:
image

Versions:

"svelte": "^3.49.0",
"svelte-preprocess": "^4.10.6",
"vite": "^3.0.2",
"sswr": "^1.7.0",
"@sveltejs/vite-plugin-svelte": "^1.0.0-next.44",

I don't use SvelteKit

What i'm missing out? What i'm doing wrong? Cant SSWR be used inside promises?

Edit:
I've tried upgrading "@sveltejs/vite-plugin-svelte": "^1.1.0", but didnt make any change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant