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
There is only a <script module> and no <script> in the component, but the snippet can not be exported, because the compiler treats the $page subscription as if it were local. If I remove the $ from $page, it can be exported.
Reproduction
<scriptmodule>
import { page } from'$app/stores';export { exampleSnippet }; // type checker error: exampleSnippet not found (undefined export)
</script>
{#snippetexampleSnippet()}
{JSON.stringify($page.data)}
{/snippet}
Logs
No response
System Info
-
Severity
annoyance
The text was updated successfully, but these errors were encountered:
I don't believe this can work, as the template needs to create a subscription to the store and the only way we can do that is by using the component's effect to dispose of it. So in this case, you can't reference a store from within a snippet that needs to be exported using the $ prefix.
Describe the bug
There is only a
<script module>
and no<script>
in the component, but the snippet can not be exported, because the compiler treats the$page
subscription as if it were local. If I remove the$
from$page
, it can be exported.Reproduction
Logs
No response
System Info
Severity
annoyance
The text was updated successfully, but these errors were encountered: