You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create a firebase project with Next.js hosting. Use export in .env, then try to deploy via firebase deploy.
It's not totally clear to me if having a "test" alias for the firebase project is relevant to .env.test getting picked up, but I'll mention it in case it is.
[REQUIRED] Expected behavior
Firebase successfully deploys, either ignoring .env.test, or at least parsing it without crashing.
[REQUIRED] Actual behavior
Firebase complains that export is not valid syntax, which is incorrect. Basically everyotherdotenvparserimplementation supports each line being prefixed by the word export, which allows users to source that file in their shell of choice without modification during local testing.
Actual output looks like this:
=== Deploying to 'my-project-4867'...
i deploying functions, hosting
i functions: preparing codebase firebase-frameworks-my-project-4867 for deployment
i functions: ensuring required API cloudfunctions.googleapis.com is enabled...
i functions: ensuring required API cloudbuild.googleapis.com is enabled...
i artifactregistry: ensuring required API artifactregistry.googleapis.com is enabled...
✔ functions: required API cloudbuild.googleapis.com is enabled
✔ functions: required API cloudfunctions.googleapis.com is enabled
✔ artifactregistry: required API artifactregistry.googleapis.com is enabled
i functions: Loading and analyzing source code for codebase firebase-frameworks-my-project-4867 to determine what to deploy
Serving at port 8221
Error: Failed to load environment variables from .env.test.:
- FirebaseError Invalid dotenv file, error on lines: export X=y
Hi @staticshock, thanks for the detailed report and for providing relevant code. I was able to reproduce this. I’ll mark this as reproducible and notify our engineering team so they can take a look.
[REQUIRED] Environment info
firebase-tools: 13.0.1
Platform: macOS
[REQUIRED] Test case
[REQUIRED] Steps to reproduce
Create a firebase project with Next.js hosting. Use
export
in.env
, then try to deploy viafirebase deploy
.It's not totally clear to me if having a "test" alias for the firebase project is relevant to
.env.test
getting picked up, but I'll mention it in case it is.[REQUIRED] Expected behavior
Firebase successfully deploys, either ignoring
.env.test
, or at least parsing it without crashing.[REQUIRED] Actual behavior
Firebase complains that
export
is not valid syntax, which is incorrect. Basically every other dotenv parser implementation supports each line being prefixed by the wordexport
, which allows users to source that file in their shell of choice without modification during local testing.Actual output looks like this:
Link to relevant parser code: https://github.com/firebase/firebase-tools/blob/master/src/functions/env.ts#L114-L149
The text was updated successfully, but these errors were encountered: