You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
…but if I first try to destructure those properties using {@const}, I get this error:
ReferenceFrror: sortedBy is not defined at Array.create_after_title_slot (and so on)
** My hunch is this has to do with the `{@const being considered part of the default slot of its parent's component, while I'm technically trying to use its destructured values in another slot.
[HMR][Svelte] Failed to rerender <+page>
ReferenceError: sortedBy is not defined
at Array.create_after_title_slot (https://dev.carevoyance.com:5001/src/routes/app/(:5001/app/field/providers/search)/field/providers/[providerId]/+page.svelte?t=1684125015357:1729:17)
at create_slot (index.mjs:71:28)
at fallback_block_2 (MiniDossierSection.svelte:68:53)
at create_if_block_4 (MiniDossierSection.svelte:68:53)
at create_if_block_1 (MiniDossierSection.svelte:69:22)
at create_fragment (MiniDossierSection.svelte:67:19)
at init (index.mjs:2113:37)
at new MiniDossierSection (MiniDossierSection.svelte:50:21)
at createProxiedComponent (svelte-hooks.js?v=ddc96c07:341:9)
at new ProxyComponent (proxy.js?v=ddc96c07:242:7)
This works as expected - your hunch is right that you're declaring the @const in the default slot scope but then try to use it in the named slot scope, where it's not defined. Therefore closing. Svelte 5 makes this more obvious with using snippets/render tags instead.
Describe the bug
I can reference properties from a store like this in my template code:
…but if I first try to destructure those properties using
{@const}
, I get this error:ReferenceFrror: sortedBy is not defined at Array.create_after_title_slot
(and so on)** My hunch is this has to do with the `{@const being considered part of the default slot of its parent's component, while I'm technically trying to use its destructured values in another slot.
Addtl referential screenshots
Reproduction
☝🏼 this one actually works and appears to confirm my above hunch
Logs
System Info
Severity
annoyance
The text was updated successfully, but these errors were encountered: