-
Hi all, has anyone else had trouble with getting
This works locally as a docker image But, the endpoint is undefined on GCR. My next process will be to use a different bundler/UI tool, (essentially one that doesn't use import.meta.env) but wanted to see if anyone else has come across this issue? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 9 replies
-
did you solve this problem? |
Beta Was this translation helpful? Give feedback.
-
Hello, I apologize for the delay in responding to this issue. To troubleshoot the issue you're facing with import.meta.env variables not working in GCR, it's essential to confirm whether the special expression is being replaced as expected. You can check this by comparing your code before and after the replacement: - globalThis.import_meta_env = JSON.parse('"import_meta_env_placeholder"')
+ globalThis.import_meta_env = JSON.parse('{"NAME":"production"}'); If the replacement is not occurring as it should, you can execute the following command before serving your application to ensure the proper substitution: npx import-meta-env -x .env.example You can find a complete example in these links: I hope this helps you resolve the issue you're experiencing. If you have any further questions or require additional assistance, please don't hesitate to reach out. |
Beta Was this translation helpful? Give feedback.
It seems that the environment variables are not passed into the container.
I found this article for you.
hope it helps you.