Quantcast
Channel: Active questions tagged svelte - Stack Overflow
Viewing all articles
Browse latest Browse all 1541

Error when importing svelte.ts into a .svelte file

$
0
0

I'm working on an Svelte application and trying to setup a rune "state" storage in its own separate file so it can be reused, but when trying to import on a .svelte component, I get a compilation error.

"Svelte: Module './TopBar.svelte' has no exported member menuButtonVisible"

// TopBar.svelte.tsexport const menuButtonVisible = $state(false);
// TopBar.svelte<script lang="ts">...import { menuButtonVisible } from './TopBar.svelte';...</script>

I'm basically trying to do the same as explained over herehttps://svelte.dev/docs/svelte/stores#When-to-use-stores

Note that when I import regular .ts files, I don't get that error. So, it looks like there should be some configuration missing to process .svelte.ts files?https://svelte.dev/docs/svelte/svelte-js-files


Viewing all articles
Browse latest Browse all 1541

Trending Articles