Can't access gatsby environment variables on the client side

前端 未结 5 1181
旧时难觅i
旧时难觅i 2021-02-19 00:44

I set up .env file and gatsby-config.js as below.

// .env.development
GATSBY_API_URL=https://example.com/api
         


        
5条回答
  •  遥遥无期
    2021-02-19 01:17

    Maybe worth noting that it's easy to misname the file if you are used to writing .dev or .develop.

    Gatsby requires that the file is named exactly: .env.development

提交回复
热议问题