Skip to content

[svelte-query] createQueries crashes when several items are removed from the array simultaneously #10341

Description

@Doverstav

Describe the bug

When using createQueries, changes to the array where two or more items are removed simultaneously causes a crash with the following error:

TypeError: can't delete property '3': proxy deleteProperty handler returned false
in $effect.pre
in FilterDrawer.svelte
in ListPage.svelte
in index.svelte
in AnchorDecorator.svelte
in ScrollDecorator.svelte
in DecoratorWrapper.svelte
in RenderFragment.svelte
in ComposeFragments.svelte
in Noop.svelte
in AnchorDecorator.svelte
in ScrollDecorator.svelte
in DecoratorWrapper.svelte
in RenderFragment.svelte
in ComposeFragments.svelte
in AnchorDecorator.svelte
in Router.svelte
in QueryClientProvider.svelte
in App.svelte

Your minimal, reproducible example

https://svelte.dev/playground/2b60862d9c564cd1b211738f60e6b729?version=5.55.0

Steps to reproduce

  1. Go to the linked example
  2. Try adding one or several elements to the array using the buttons, notice that it works
  3. Try removing a single element using the button, this also works
  4. Then try removing two items using the buttons, the page will now crash. Using slice() or splice() makes no difference. (the console in svelte playground isn't great, you'll have to open the console in the browser to see the error proper)

Expected behavior

I expect useQueries to update its result with fewer queries made, but instead it crashes.

How often does this bug happen?

Every time

Screenshots or Videos

createQueriesCrash.mp4

Platform

  • OS: Windows
  • Browser: Firefox 148.0.2

Tanstack Query adapter

svelte-query

TanStack Query version

v6.1.10

TypeScript version

v5.9.3

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions