-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
defineCollection and other declarations missing from generated types for "astro:content" module #12439
Labels
needs triage
Issue needs to be triaged
Comments
I do have the same issue.
Worth to mention that the build works perfectly, it's just in Vscode. Also here is what eslint says:
|
Ah anyway, I figured out I forgot to include |
1 task
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Astro Info
If this issue only occurs in one browser, which browser is a problem?
No browser; this is a development issue
Describe the Bug
With a minimal project using yarn 4.5.1, Astro 4.16.12 and the latest official VSCode Astro extension, I'm getting an error in my
src/content/config.ts
file when I try to do the following import:This is the error I see:
I can confirm that, indeed, the
defineCollection
andz
declarations are missing from the.astro/astro/content.d.ts
typing file. (I can share the contents of that file if desired, but you should be able to reproduce with my sample.)I've linked a minimal reproduction. To initialize the project, I just ran
yarn init -2
, added the relevant Astro dev dependencies, and pasted in a few filler content files. I see the same issue whether I put everything intodependencies
ordevDependencies
in mypackage.json
, so it does not appear to be a dev-vs-runtime dependency issue.Note that I wasn't able to insert slashes (
/
) into the gist files, so I've replaced those with underscores (_
).I've also run
astro sync
,astro check
, andastro build
. All result in the same VSCode type error. I am able to successfully build and view the website.Finally, the closest previous issue I could find to this one was #5711, which seems to be complaining that the module doesn't exist at all. This is not what I'm seeing; instead, I'm seeing that not all of the module exports are getting into the declaration file.
What's the expected result?
The
.astro/astro/content.d.ts
should contain all relevant typings and should allow type checking of collection schemas.Link to Minimal Reproducible Example
https://gist.github.com/bsidhom/88417490e8dc651a17f1608c5af3067c
Participation
The text was updated successfully, but these errors were encountered: