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

Unable to access environment variables with Node.js after npm run build #1136

Open
calycekr opened this issue May 13, 2024 · 2 comments
Open

Comments

@calycekr
Copy link

calycekr commented May 13, 2024

I have no problem accessing environment variables from .env.local with npm run dev or npm run preview, but when I run with node build after npm run build, I can't access environment variables.

@CakeCrusher
Copy link

When you run npm run build you are executing a proxy for vite build which is a different build process than node build. Although I cant pinpoint why the env variables are not accessible, the downstream effects of the change likely cause that.

@calycekr
Copy link
Author

sveltejs/kit#11502 (comment)

Same issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants