CaptainCodeman / svelte-headlessui

HeadlessUI components for Svelte
https://captaincodeman.github.io/svelte-headlessui/
MIT License
554 stars 25 forks source link

Uncaught TypeError: stop is not a function #41

Closed Smirow closed 4 months ago

Smirow commented 1 year ago

I got this error:

index.mjs:54 Uncaught TypeError: stop is not a function
    at index.mjs:54:17
    at behavior.ts:6:52

when a menu (dropdown) is unmounted while redirecting. Seems like it has something to do with unsubscribing: https://github.com/CaptainCodeman/svelte-headlessui/blob/f11d3ad90023e13c7a3ae0e086a4b150c9db1ca1/packages/lib/src/lib/internal/behavior.ts#L4-L7

see https://github.com/sveltejs/svelte/issues/4765 and https://github.com/sveltejs/svelte/pull/8186

Maybe the error should be catched and silenced while waiting for the PR above to land, or finding a way to prevent these falsy unsubscribe?

CaptainCodeman commented 1 year ago

Thanks, I'll checkout those issues

CaptainCodeman commented 4 months ago

assuming this is fixed as those PRs are merged