Can not access process env client side except root page. #8901
Unanswered
yuta-hidaka
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello, I've tried to read the env variable on the client side.
I saw the document to get the env variable on the client side.
I implemented it that way, but in the root directory, I can see the window.process.env property, but when I got to another page directory like /foo and accessed the property via
clientLoader
the value got undefined.But, open the dev tool and see the source code, you can see the script that injects env variables.
There is a sum up of what I did.
This is can access
window.process.
window.process
.This can not be accessed.
clientLoader
on another page, I can not accesswindow.process
window.process.
but the script can see it.I've created a reproduction repo can you point out what I missing?
https://github.com/yuta-hidaka/remix-env-can-not-read-except-root
Beta Was this translation helpful? Give feedback.
All reactions