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
Built in Vite env vars seem incorrect in prerender hook #25
Comments
Seems like a Vite bug. I will have a look. |
Couldn't reproduce. The output in 764e8e5 is correct. Note that your But that besides the point since it should work nevertheless and simply doing |
Oh dear. I will try again with the commit you have referenced to see if I can figure out why I was getting different results. |
No worries. The commit lives in the |
OK now I am getting DEV: false, PROD: true, which would be correct, however I am still not seeing SSR populated at all. Were you seeing evidence of SSR env being set inside of prerender hooks as well? |
Yes I can confirm that the SSR env is missing in prod. I'm confident the problem is on Vite's side. It should be easy to reproduce on https://github.com/vitejs/vite/tree/main/packages/playground/ssr-vue. |
OK going to go ahead and close this then. For clarity, I believe the fix here was removeing |
Repro Steps:
import.meta.env
from inside a page's prerender hookcross-env NODE_ENV=production && npm run build && vite-plugin-ssr prerender --clientRouter
Expected Results:
Having specified NODE_ENV=production, I would expect DEV=false, PROD=true. Additionally, I would expect SSR=true to come through, but it is not showing up at all.
The text was updated successfully, but these errors were encountered: