-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
astro:env does not generate .astro/env.d.ts in develoment mode #11380
Comments
You should run |
should it be the expected behaviour? or astro could be generate types file automatically on dev mode? |
Yes dev should run sync under the hood so there may be a bug, I'll have a look |
I think the issue lies here https://github.com/withastro/astro/blob/main/packages/astro/src/core/sync/index.ts#L87. If there are no content collections, the env sync code may not be run. @xino1010 do you want to try fixing it? |
Ah yeah, that's because |
No sorry, it exceed of my knowledge |
@florian-lefebvre I'm happy to submit a PR for this if that's ok? |
@Trombach sure do it! Feel free to reach out on Discord in |
I get this too, they are simply undefined, I use
|
@nemanjam 👋 Can you open a new issue? Thank you! |
Here it is: |
Astro Info
Using last experimental type-safe environment variables features, types are not generated automatically in development mode.
Cannot find module 'astro:env/server' or its corresponding type declarations.ts(2307)
I have to execute
to remove the ts error.
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
Code works but intellisense show an error.
Looking the file
env.d.ts
new line is added but the file is not generated under
.astro
folder.Same happens for backend vars.
but if you execute
npm run build
, the error dissapears because typings file is generated.What's the expected result?
Generate automatically
env.d.ts
file on develoment mode.Link to Minimal Reproducible Example
https://stackblitz.com/edit/withastro-astro-ey4hsq?file=.env
Participation
The text was updated successfully, but these errors were encountered: