Skip to content

fix(svelte-query): fix error when creating query outside of component #9222

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

Open
wants to merge 1 commit into
base: svelte-5-adapter
Choose a base branch
from

Conversation

arnolicious
Copy link

Description

This fixes an effect_orphan error that occurs, when createQuery gets called in an event listener, or simply outside of component initialization.

I simply added $effect.root around the $effects in createBaseQuery.svelte.ts which fixed the error on my end while seemingly not breaking anything.

… initialization

Add $effect.root to allow creating queries in event handlers. Previously creating a query outside of component initialization would throw an effect_orphan error
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant