#How to get TypeScript IntelliSense for your User Defined Environment Variables in `.env` file
8 messages · Page 1 of 1 (latest)
Not sure if it makes any difference, but I have this working without the reference types on the top line.
I was just about to say this. I believe I read in some release that generated types were moved from env.d.ts to .astro/types.d.ts as well. I wonder if this is causing a conflict.
Can you try naming the file env.d.ts instead of .env.d.ts? I'm not sure if typescript picks up files starting with a .
Dude you are a life saver. I now have auto completion.
I see that i misread the documentation. I accidentally added a .
No worries. Glad it's working now 😊
If your issue is resolved, please help by doing the following two steps:
- From the ellipses (3-dot menu) in the top-right corner of the post (not the first message), edit the tags to include the Solved tag.
- From the same ellipses, select Close Post.
Your post will still be available to search and can be re-opened simply by replying in it. Closing a post moves it down with older posts, so we can more easily focus on issues that still need to be resolved.
Thank you for your help!