create react app not picking up .env files?

前端 未结 10 2078
醉话见心
醉话见心 2020-12-12 19:52

I am using create react app to bootstrap my app.

I have added two .env files .env.development and .env.production in the root.

10条回答
  •  时光取名叫无心
    2020-12-12 20:40

    I was having the same problem, but it was because I had my .env file in YAML format instead of JS.

    It was

    REACT_APP_API_PATH: 'https://my.api.path'
    

    but it needed to be

    REACT_APP_API_PATH = 'https://my.api.path'
    

提交回复
热议问题