Skip to content

You are trying to load env variables which are already present in your project root .env #4098

@flybayer

Description

@flybayer

Bug description

2.10.1 is not working with .env in root when those variables are already loaded with another tool (which is the case with Blitz which runs dotenv-flow on boot).

error - [Error:
      You are trying to load env variables which are already present in your project root .env
        Root: /sandbox/.env
        Prisma: ./.env
        Env Conflicts:
                DATABASE_URL

      You can fix this by removing the .env file from "./.env" and move its contents to your .env file at the root "/sandbox/.env"
      ] {
  clientVersion: '2.10.1'
}

How to reproduce

  1. Open https://codesandbox.io/s/wonderful-snow-2tnt2?file=/.env
  2. Reload the app page
  3. Look at the terminal logs

You should also be able to reproduce by using dotenv to load the env vars from .env before using prisma.

Expected behavior

No error

Prisma information

2.10.1

Environment & setup

  System:
    OS: macOS 10.15.7
    CPU: (16) x64 Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
    Memory: 3.34 GB / 64.00 GB
    Shell: 3.1.2 - /usr/local/bin/fish

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions