Skip to content

NextJs Hosting not picking up .env.develop only .env.production #8543

Closed
@JackMF

Description

@JackMF

[REQUIRED] Environment info

firebase-tools: 14.3.1

Platform: macOs

[REQUIRED] Test case

set up a next js project following this guide: https://firebase.google.com/docs/hosting/frameworks/nextjs

[REQUIRED] Steps to reproduce

  1. Make your repo support mutiple firebase projects by changing your .firebaserc to have
{
  "projects": {
    "develop": "project-dev-id",
    "production": "project-prod-id"
  }
}
  1. Have 3 env files:
    .env
    .env.develop
    .env.production

  2. Deploy project by using:

firebase use develop
firebase deploy

[REQUIRED] Expected behavior

I would expect the project to build with the .env.develop vars

[REQUIRED] Actual behavior

The project builds with the .env.production

info  - Loaded env from .env.production

info  - Loaded env from .env

Note this also happens if you set the develop env file to be called: .env.project-dev-id.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions