Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dotenv files ignored when deploying nextjs apps #8076

Open
CHAKlBDEV opened this issue Dec 20, 2024 · 1 comment · May be fixed by #8086
Open

dotenv files ignored when deploying nextjs apps #8076

CHAKlBDEV opened this issue Dec 20, 2024 · 1 comment · May be fixed by #8086

Comments

@CHAKlBDEV
Copy link

CHAKlBDEV commented Dec 20, 2024

[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("\\","/");

leoortizz added a commit that referenced this issue Dec 30, 2024
@leoortizz leoortizz linked a pull request Dec 30, 2024 that will close this issue
@leoortizz leoortizz self-assigned this Dec 30, 2024
@leoortizz
Copy link
Member

Thanks @CHAKlBDEV for reporting the issue. #8086 should fix this. As soon as it's merged and a new version of firebase-tools is released with this change, this issue will be fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants