Skip to content

dotenv files ignored when deploying nextjs apps #8076

Closed
@CHAKlBDEV

Description

@CHAKlBDEV

[REQUIRED] Environment info

firebase-tools: 13.29.1

Platform: Windows

[REQUIRED] Test case

Nextjs project with .env.* files

[REQUIRED] Steps to reproduce

  1. Create new nextjs project
  2. Create .env.production file
  3. Set up firebase
  4. Create "production" alias
  5. Deploy

[REQUIRED] Expected behavior

Expected firebase-tools to pick up .env.production

[REQUIRED] Actual behavior

.env.production is not picked up

Problem

Here we're supposed to find all environment variable files. The issue is that glob doesn't support backslashes. They're instead used for escaping something or another and node's path.join (in getProjectPath) does return paths with backslashes.

Potential solution

Replace all backslashes with forwards

const getProjectPath = (...args: string[]) => join(projectRoot, source, ...args).replaceAll("\\","/");

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions