Join 1M+ other developers and:
- Get help and share knowledge in Q&A
- Subscribe to topics of interest
- Get courses & tools that help you grow as a developer or small business owner
ENV vars don't get loaded on build-time in Worker components?
I have configured ENV vars via the App Platform UI for my new Worker component. The ENV vars were not loaded in on the Build stage of the Worker component.
It looks like these ENV vars do not get the default BUILDANDRUN_TIME scope. The “scope” key is non-existent if I inspect my Appspec via doctl. I had to manually add the “scope” key in my Worker component to make the Worker build work.
This is a bit confusing because the UI where you can manage ENV vars for Worker components also describes that the ENV vars will be added to the Build and Runtime stage.
This might be a bug or intentional. But if intentional, the ENV var management UI for Workers is a bit off.
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.×