chat-ui icon indicating copy to clipboard operation
chat-ui copied to clipboard

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

Open calycekr opened this issue 9 months ago • 2 comments

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.

calycekr avatar May 13 '24 13:05 calycekr

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.

CakeCrusher avatar May 23 '24 03:05 CakeCrusher

https://github.com/sveltejs/kit/discussions/11502#discussioncomment-7998898

Same issues.

calycekr avatar May 30 '24 08:05 calycekr