Treating warnings as errors because process.env.CI = true #25228
-
Hey, since about 2 days now our working github action fails with “Treating warnings as errors because process.env.CI = true.” because the webpack build returns a few size warnings. I tried to simply circumvent this for now by setting CI to false but I cannot figure out how. It does not work if I set it inside the workflow via
or if I include it in the npm command directly. What am I doing wrong? kind regards |
Beta Was this translation helpful? Give feedback.
Replies: 10 comments 3 replies
-
can you try setting
|
Beta Was this translation helpful? Give feedback.
-
Hey, and thanks for the suggestion. Unfortunately it did not resolve the situation. Just to be sure I added the CI env variable to the job as well as to the step in the workflow file. I also printed the env object to see what was in there as part of the job.
This is what I got:
I must be missing something obvious… |
Beta Was this translation helpful? Give feedback.
-
Wait, I think it actually worked. Huh, that’s interesting - why is empty string working but false is not? Thanks a lot, @ericsciple |
Beta Was this translation helpful? Give feedback.
-
Glad someone else ran into this, I thought I was going crazy when all my deploys quit working. |
Beta Was this translation helpful? Give feedback.
-
My best guess is the downstream tool may check for the existence of the variable (not empty) or might check for “0” instead of “false” or something |
Beta Was this translation helpful? Give feedback.
-
Seems to be exactly the issue
|
Beta Was this translation helpful? Give feedback.
-
So what changed ? Did github start setting the CI variable ? is there an annoucement ? It’s not mentionned in https://help.github.com/en/actions/configuring-and-managing-workflows/using-environment-variables#default-environment-variables Cheers, Jon |
Beta Was this translation helpful? Give feedback.
-
Regarding the “false” value, maybe OP had old react-scripts ? Fixed in 2017: facebook/create-react-app@5b38c54 With recent react-scripts, using the following works:
|
Beta Was this translation helpful? Give feedback.
-
I ran into the same issue while using react@17.0.2 and react-scripts@5.0.0 when I updated my git repo, the solution for me was by following the same suggestion the original poster encountered and setting the environment CI = true in Netlify’s Environment variables. |
Beta Was this translation helpful? Give feedback.
-
change it to CI=false npm run build |
Beta Was this translation helpful? Give feedback.
can you try setting