react app don't get env from azure static web app

Ari Gabay 41 Reputation points
2021-11-10T19:29:41.577+00:00

Hi Everyone,
I have react web app on the azure static web app.
my app gets an error because I don't get env from azure.
I'm doing a console log with "process.env" and I don't get the env from azure.
but in the local, I got env from env file and all run perfectly.
thanks for all.

148345-envpic.png

Azure Static Web Apps
Azure Static Web Apps
An Azure service that provides streamlined full-stack web app development.
1,173 questions
0 comments No comments
{count} votes

Accepted answer
  1. Grmacjon-MSFT 19,151 Reputation points Moderator
    2021-11-11T19:46:35.437+00:00

    Hi @Ari Gabay ,

    We apologize for the inconvenience this issue may have caused. It looks like this is a known issue. The Static Web Apps task runs in a container. Variables are not passed into it by default. The engineering team is working on a fix for this. in the meantime, please take look at this workaround provide in this Github thread

    Hope that helps. Please let us know if you have further questions.

    Thanks,
    Grace

    ------------------------------------------------------------------------------------------------------------------------------

    --If the reply is helpful, please Upvote and Accept as answer--


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.