Closed djkato closed 3 days ago
cc @bluwy
- import { SelectInline } from "./universal/SelectInline.svelte"
+ import SelectInline from "./universal/SelectInline.svelte"
Svelte components are default exported. I'm not sure why Vite isn't giving nice errors here, I'd suggest reporting an issue to Vite to possibly improve this. Closing this as I don't think it's a bug Astro can fix.
@bluwy
IDE Does give me warning about importing it this way.
Initially inside my app when I started migrating from svelte 4 to svelte 5, all my imports were the way you suggested. Every single svelte file trying to import a svelte component had error about the imports, which almost all went away when I started importing it the "wrong way". After importing it with {}
only like 5 erroring files remained, which had the issues I reported here.
import SelectInline from "./universal/SelectInline.svelte"
Fails right inside the file that tries to import.
import { SelectInline } from "./universal/SelectInline.svelte"
It starts complaining inside the component, which means it imported correctly, no?
These errors are still in my repro repo.
I'm not getting any errors after updating to default imports in the repro. The errors you show seem strange to me and implies some sort of JS parsing error. Maybe you can try re-installing dependencies or use a different package manager? Also, the overrides
in your package.json can also be removed.
The package manager was the issue. After I switched from bun to pnpm it builds correctly. I'll go report it there then, thanks for the hint :)
Astro Info
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
What's the expected result?
To either give proper reasons why something is broken, or just work? I don't see what's wrong in my code.
Link to Minimal Reproducible Example
https://github.com/djkato/astrojs-svelte-error
Participation