Skip to content

ENV vars set via dotenv don't get picked up #402

@norahine

Description

@norahine

Hello,

I'm trying to set the credentials using dotenv (in .env.development and .end.production files).

However, the deployment script ("deploy": "npm run -n \"-r dotenv/config\" && npm run build && gatsby-plugin-s3 deploy") is not picking them up (I confirmed this by passing them explicitly to npm run deploy).

At the top of gastby-config.js I have:

require("dotenv").config({
  path: `.env.${process.env.NODE_ENV}`,
}),

Did I miss anything? Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions