Getting {"severity":"WARNING","message":"Warning, FIREBASE_CONFIG and GCLOUD_PROJECT environment variables are missing. Initializing firebase-admin will fail"} {} error
As the title says - when I run $ npx @firebaseextensions/fs-bq-schema-views
--non-interactive
--project=${param:PROJECT_ID}
--dataset=${param:DATASET_ID}
--table-name-prefix=${param:TABLE_ID}
--schema-files=./test_schema.json
I'm getting that error and not sure what to do?
Hi @xtxixkx.
If I remember correctly the module will still run as expected, do you have any issues generating schemas?
I'll also flag this for discussion to investigate why this error appears.
@dackers86 Thanks for your reply! Unfortunately, I'm not seeing any schemas being generated when executing Step 4. The error is Step 3 seems to be a blocker for me.
@dackers86 Hey there! - I'm wondering if there is a way I can set FIREBASE_CONFIG and GCLOUD_PROJECT environment variables to resolve this error?
Hi @xtxixkx
Are there any other errors that appear in the terminal?
Could you provide a full example of the output? Thanks!
I have been able to create a schema through the gen-schema script.
There is still an unnecessary warning message {"severity":"WARNING","message":"Warning, FIREBASE_CONFIG and GCLOUD_PROJECT environment variables are missing. Initialising firebase-admin will fail"} but this does not seem to stop the schema from generating.
Let me give it another try today and I'll report back!
I ran into exactly the same issue. Wonder if there is any update on this one
After I changed to use relative file path to the json file, it seems generating the view.
Hi! @cabljac @dackers86 I'm getting a similar error. Is it possible to solve it?
$ npx @firebaseextensions/fs-bq-import-collection
{"severity":"WARNING","message":"Warning, FIREBASE_CONFIG and GCLOUD_PROJECT environment variables are missing. Initializing firebase-admin will fail"}
Unexpected token '.'
SyntaxError: Unexpected token '.'
at wrapSafe (internal/modules/cjs/loader.js:915:16)
at Module._compile (internal/modules/cjs/loader.js:963:27)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
at Module.load (internal/modules/cjs/loader.js:863:32)
at Function.Module._load (internal/modules/cjs/loader.js:708:14)
at Module.require (internal/modules/cjs/loader.js:887:19)
at require (internal/modules/cjs/helpers.js:74:18)
at Object.<anonymous> (/Users/fumitaka_ito/.npm/_npx/d906c8461d95e111/node_modules/@firebaseextensions/firestore-bigquery-change-tracker/lib/bigquery/index.js:30:24)
at Module._compile (internal/modules/cjs/loader.js:999:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
Of course, the following command also produces a similar error.
$ npx @firebaseextensions/fs-bq-schema-views
{"severity":"WARNING","message":"Warning, FIREBASE_CONFIG and GCLOUD_PROJECT environment variables are missing. Initializing firebase-admin will fail"}
Unexpected token '.'
Ran into the same issue trying to deploy my API to firebase using firebase functions. Any solutions yet? @dackers86
I've added this back to our accepted column for further investigation.
From the examples above, I need to clarify the issues we are facing. Separating concerns here will make the issues easier to track.
Am I correct in saying the following are existing issues...
-
Running the import script produces a warning stating
{"severity":"WARNING","message":"Warning, FIREBASE_CONFIG and GCLOUD_PROJECT environment variables are missing. Initializing firebase-admin will fail"} -
I receive the error
SyntaxError: Unexpected token '.'when running the following commandnpx @firebaseextensions/fs-bq-schema-views -
Running OP's original script will produce the error
{}.
Additional information
Could developers provide information including:
Platform: eg. Windows/linux/IOS
Version: npx @firebaseextensions/fs-bq-schema-views --version
Firebase version: firebase --version
Node version: node -v
The latest version 0.4.5 (from NPM) doesn't work at all, you get the OP warning and if you try to pass actual parameters you get this:
error details
{"code":"app/duplicate-app","message":"The default Firebase app already exists. This means you called initializeApp() more than once without providing an app name as the second argument. In most cases you only need to call initializeApp() once. But if you do want to initialize multiple apps, pass a second argument to initializeApp() to give each app a unique name."}
The default Firebase app already exists. This means you called initializeApp() more than once without providing an app name as the second argument. In most cases you only need to call initializeApp() once. But if you do want to initialize multiple apps, pass a second argument to initializeApp() to give each app a unique name.
I took the source and it seems that the import of RawChangelogViewSchema from "@firebaseextensions/firestore-bigquery-change-tracker"; cause all the issues. I didn't deep dive into what's going on in that package but I have a feeling that it also calls firebase admin init or something of such sort.
take the source, remove the import and paste the type that that import needs and it works.
I got same error, but after I deleted GOOGLE_APPLICATION_CREDENTIALS environment variable, it worked. I accidentally configured this environment variable.
related doc: https://cloud.google.com/docs/authentication/provide-credentials-adc