dev-protocol/devprotocol.xyz

[BUG] .env files not working on current version of astro

Simperfy opened this issue · 0 comments

Problem subject

  • Other - .env not working

Description

I followed the official guide on using .env variables of astro but found that it wasn't working as written in the docs, the import.meta.env variables are always empty. Also tried using process.env but the variables I need wasn't there.

Here's an example with our current version (0.20.9): https://stackblitz.com/edit/github-rpfxhk-bea9it?file=package.json&on=stackblitz
And here's the latest (0.21.13) https://stackblitz.com/edit/github-rpfxhk-enisy5?file=package.json&on=stackblitz

I got the sample snippet from this issue: withastro/astro#2027

Expected behavior/contents

.env should load the variables to import.meta.env as written in the astro documentation.

Actual behavior/contents

.env is not loading the variables to import.meta.env.

Code of Conduct

  • I agree to follow this project's Code of Conduct