Global variable `Astro` type is `any` when migrating from v3 to v4

I'm migrating my project from Astro v3 to v4. Now, the linter gives me errors as Astro type is any. Any idea what can be wrong? EDIT: it happens only when I use the global variable inside getStaticPaths. If I rename the function, it works! (see video in the thread)
No description
Solution:
I had the help of an Astro team member, the bug has been identified, there is like a loop when inferring getStaticPaths. Here are two workarounds: - Explicit the type returned by getStaticPaths instead of inferring it; - Use directly import.meta.glob instead of Astro.glob....
Jump to solution
2 Replies
Benjamin
Benjamin•11mo ago
So it happens only when I use the global variable inside getStaticPaths. If I rename the function, it works! 🤯
Solution
Benjamin
Benjamin•11mo ago
I had the help of an Astro team member, the bug has been identified, there is like a loop when inferring getStaticPaths. Here are two workarounds: - Explicit the type returned by getStaticPaths instead of inferring it; - Use directly import.meta.glob instead of Astro.glob.
Want results from more Discord servers?
Add your server