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
The following bug thrown for harambasic.de/src/pages/posts/[slug].astro:4:27 gets fixed when I remove the function from harambasic.de/src/util/api/categories.ts (see LukaHarambasic/harambasic.de@2b1ab7e (ignore the formatting noise).
So a bug in harambasic.de/src/util/api/categories.ts exists but it shows that a type import is the problem.
Is this maybe a vite bug?
I just find it very confusing and it took me some time to figure it out.
#5316 will slightly improve the message, by adding the nuance that this is often caused by a typo, but might not be the case
But, unfortunately the fix in that PR isn't super informative either - Vite gives a super generic error whenever it fails to import a file (which in a lot of cases, it simply a typo) so we don't have much information to go on apart that, well, the import failed
We will soon take the following steps for this:
Contribute a better error message to Vite itself
Add an extended description in our docs (that you'll be able to go to directly from the error overlay) that list more common cases, such as this one
Activity
LukaHarambasic commentedon Nov 8, 2022
Found the error, a type import wasn't explicit - LukaHarambasic/harambasic.de@37f51b0
But I still think the error message is kind of strange.
Princesseuh commentedon Nov 8, 2022
#5316 will slightly improve the message, by adding the nuance that this is often caused by a typo, but might not be the case
But, unfortunately the fix in that PR isn't super informative either - Vite gives a super generic error whenever it fails to import a file (which in a lot of cases, it simply a typo) so we don't have much information to go on apart that, well, the import failed
We will soon take the following steps for this:
Hopefully, that'll make things much clearer!
Thank you for reporting this issue!
Princesseuh commentedon Nov 9, 2022
Here's the upstream issue to track for this: vitejs/vite#10002
bluwy commentedon Nov 22, 2022
Closing as vitejs/vite#10002 is fixed. It's merged into Vite 4 and will provide a similar error message to what Astro provides now.
LukaHarambasic commentedon Nov 22, 2022
@Princesseuh & @bluwy, thanks for being so nice and quick. You and the whole team(s) are doing an amazing job!
Princesseuh commentedon Nov 22, 2022
No problems, always happy to help!