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

DOMException when using proxied state for VisualizationSpec #984

Open
tachiniererin opened this issue Dec 10, 2024 · 1 comment
Open

DOMException when using proxied state for VisualizationSpec #984

tachiniererin opened this issue Dec 10, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@tachiniererin
Copy link

While updating from Svelte 4 to 5 I noticed that when I now use $state for the visualization spec that it throws an exception in case I try to use deeply reactive state.

// this throws an exception
let spec: VisualizationSpec | undefined = $state(undefined);

// this works
let spec: VisualizationSpec | undefined = $state.raw(undefined);

I'm not quite sure what the underlying issue is, but it might be useful at least to document this in case someone else runs into the same problem in the future.

DOMException: Proxy object could not be cloned.
    normalizeChannelDef selectioncompat.ts:102
    mapLayerOrUnit selectioncompat.ts:34
    map map.ts:37
    map selectioncompat.ts:25
    normalizeGenericSpec index.ts:56
    normalize3 index.ts:31
    compile compile.ts:92
    lite embed.ts:114
    _embed embed.ts:318
    embed embed.ts:262
    createView VegaEmbed.svelte:123
    VegaEmbed VegaEmbed.svelte:58
    untrack runtime.js:992
    VegaEmbed VegaEmbed.svelte:54
    update_reaction runtime.js:394
    update_effect runtime.js:520
    flush_queued_effects runtime.js:631
    flush_queued_root_effects runtime.js:610
    process_deferred runtime.js:662
    schedule_effect runtime.js:681
    mark_reactions sources.js:248
    internal_set sources.js:163
    set sources.js:149
    <anonymous> +page.svelte:337
    acceptExports client:46
    fetchUpdate client:208
    queueUpdate client:183
    queueUpdate client:183
    handleMessage client:879
    handleMessage client:877
    onMessage client:298
    connect client:428
    connect client:427
    connect client:760
    connect client:279
    connect client:372
    <anonymous> client:857
@tachiniererin tachiniererin added the bug Something isn't working label Dec 10, 2024
@Sparkier
Copy link
Collaborator

Hey, I just tried to reproduce this but I was not able to. What I did was set the reactive spec in our SvelteKit sample project of the visualization to undefined. Everything worked fine for me (no chart obviously, but no error either).

Could you share some more detail about this or maybe provide code to reproduce this behavior?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants