Skip to content
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

🐛 BUG: vite.envDir is ignored when building #3646

Closed
1 task
nrgnrg opened this issue Jun 20, 2022 · 3 comments
Closed
1 task

🐛 BUG: vite.envDir is ignored when building #3646

nrgnrg opened this issue Jun 20, 2022 · 3 comments
Assignees
Labels
- P4: important Violate documented behavior or significantly impacts performance (priority)

Comments

@nrgnrg
Copy link
Contributor

nrgnrg commented Jun 20, 2022

What version of astro are you using?

^1.0.0-beta.47

Are you using an SSR adapter? If so, which one?

None

What package manager are you using?

pnpm, npm

What operating system are you using?

Mac

Describe the Bug

When building a project the vite.envDir is ignored, it works as expected using the dev server.

in the stackblitz repro

  • check npm run dev -> it works, env printed to console and UI
  • check npm run build && npm run preview and all vars are undefined
  • move .env.local to same folder as astro.config.mjs
  • check npm run build && npm run preview and it works

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-tcuzrc-mzkyt7?on=stackblitz

Participation

  • I am willing to submit a pull request for this issue.
@bholmesdev bholmesdev added - P3: minor bug An edge case that only affects very specific usage (priority) s1-small labels Jun 20, 2022
@bholmesdev
Copy link
Contributor

Thanks for the simple repro @nrgnrg! Can confirm this occurs without the .local extension as well.

@FredKSchott FredKSchott added - P4: important Violate documented behavior or significantly impacts performance (priority) and removed - P3: minor bug An edge case that only affects very specific usage (priority) labels Aug 3, 2022
@FredKSchott
Copy link
Member

Bumping up priority on anything that is a difference between dev and build!

@Princesseuh
Copy link
Member

Hello. I cannot reproduce this issue in the latest version of Astro. I suspect this was fixed by #4344

Thank you for reporting this issue! If this rehappen to you, please open another issue and we'll take a look!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- P4: important Violate documented behavior or significantly impacts performance (priority)
Projects
None yet
Development

No branches or pull requests

4 participants