According to the Firebase documentation, Loaded environment variables from .env.
should be printed to the console when deploying functions. My functions are exported inside src/functions/functions.ts
. This is specified in my package.json
file:
main: lib/src/functions/functions.js
(since I am using TypeScript, I have to specify the generated javascript file inside lib
).
I have tried to locate the .env files inside the root directory, and inside the src/functions/
folder. None of them works. Does anyone have any ideas?
3
Answers
I had the same issue, turns out the
firebase-tools
version installed globally which where used for deploy where not updated bynpm install -g firebase-tools
.Solution:
firebase-tools
versions:firebase --version
which should be more than 11which firebase
/usr/local/bin/firebase
runsudo rm -rf /usr/local/bin/firebase
npm uninstall -g firebase-tools
npm install -g firebase-tools
firebase --version
. As of 1st Oct 2022: 11.13.0i had the same problem. I was able to solve it by moving the .env files to the base of the project.
Example:
Hope it helps you
structure
or
then
In case you don’t know how to get the path: right-click your .env file in vscode => choose Copy Path
Your environment should work properly