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

cannot export .env variables in production build #3800

Closed
3 tasks done
v0xvigneshwaran opened this issue Jan 12, 2025 · 2 comments
Closed
3 tasks done

cannot export .env variables in production build #3800

v0xvigneshwaran opened this issue Jan 12, 2025 · 2 comments
Labels
blocked/needs-repro Issues unable to be reproduced by maintainers bug plugin/vite

Comments

@v0xvigneshwaran
Copy link

Pre-flight checklist

  • I have read the contribution documentation for this project.
  • I agree to follow the code of conduct that this project uses.
  • I have searched the issue tracker for a bug that matches the one I want to file, without success.

Electron Forge version

7.6.0

Electron version

v33.3.1

Operating system

mac

Last known working Electron Forge version

No response

Expected behavior

export .env variables in production build

Actual behavior

getting undefined

Steps to reproduce

  1. npx create-electron-app@latest my-new-app --template=vite-typescript
  2. create .env in root & add dotenv
  3. used them in main.ts

Additional information

The production build cannot export .env variables, but it works fine in development mode.

@isabella-projects
Copy link

Did you find a solution? I have the same problem. Locally the env vars is defined, but when I run electron-forge package they are undefined..

@erickzhao erickzhao added bug blocked/needs-repro Issues unable to be reproduced by maintainers plugin/vite labels Jan 30, 2025
@erickzhao
Copy link
Member

Image

I tried following the steps outlined in the issue and was unable to reproduce.

@erickzhao erickzhao closed this as not planned Won't fix, can't repro, duplicate, stale Jan 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked/needs-repro Issues unable to be reproduced by maintainers bug plugin/vite
Projects
None yet
Development

No branches or pull requests

3 participants