vega / svelte-vega

Svelte component for Vega and Vega-Lite
BSD 3-Clause "New" or "Revised" License
72 stars 7 forks source link

Uncaught Svelte error: effect_update_depth_exceeded #976

Closed bmschmidt closed 3 days ago

bmschmidt commented 5 days ago

Thanks for your work on this repo.

I'm having trouble getting version 3.0.0 to work reactively in a sveltekit app.

The initial load works fine, but then it goes into an infinite loop with the message below in the console.

The trace in the first line shows that the first $effect in the Embed component seems to be retriggering endlessly on a shallowEqual check.

I haven't been able to make this work in the demo repo (which still seems to be on version 1.2.0, but even after upgrading to 3.0.0) but with a fresh sveltekit and almost no edits I can reproduce.

One possibly related note: I also need to install fast-deep-equal to get the basic app to run.

To reproduce:

git clone https://github.com/bmschmidt/svelte-vega-test; cd svelte-vega-test; npm i ; npm run dev
hook.js:608 Last ten effects were:  (10) [ƒ, ƒ, ƒ, ƒ, ƒ, ƒ, ƒ, ƒ, ƒ, ƒ]
overrideMethod @ hook.js:608
infinite_loop_guard @ chunk-BWDDQV5P.js?v=30770dcb:1845
flush_queued_root_effects @ chunk-BWDDQV5P.js?v=30770dcb:1863
process_deferred @ chunk-BWDDQV5P.js?v=30770dcb:1904
Show 4 more frames
Show lessUnderstand this error
chunk-BWDDQV5P.js?v=30770dcb:173 Uncaught Svelte error: effect_update_depth_exceeded
Maximum update depth exceeded. This can happen when a reactive block or effect repeatedly sets a new value. Svelte limits the number of nested updates to prevent infinite loops
effect_update_depth_exceeded @ chunk-BWDDQV5P.js?v=30770dcb:173
infinite_loop_guard @ chunk-BWDDQV5P.js?v=30770dcb:1840
flush_queued_root_effects @ chunk-BWDDQV5P.js?v=30770dcb:1863
process_deferred @ chunk-BWDDQV5P.js?v=30770dcb:1904
Show 4 more frames
Show lessUnderstand this error
chunk-BWDDQV5P.js?v=30770dcb:173 Uncaught (in promise) Svelte error: effect_update_depth_exceeded
Maximum update depth exceeded. This can happen when a reactive block or effect repeatedly sets a new value. Svelte limits the number of nested updates to prevent infinite loops

Please:

domoritz commented 5 days ago

@Sparkier have you seen this issue before?

Sparkier commented 4 days ago

Yes, but I thought it was fixed. Let me check.

vega-org-bot commented 3 days ago

:tada: This issue has been resolved in version 3.0.2 :tada:

The release is available on:

Your semantic-release bot :package::rocket: