eficode / pipeline-the-game

A digital version of: https://www.praqma.com/stories/pipeline-card-game/
GNU General Public License v3.0
24 stars 2 forks source link

Unable to populate local Emulators with required data #257

Closed gilesreece closed 3 years ago

gilesreece commented 3 years ago

When running the command:

npm run scripts:load-initial-data:local

> root@ scripts:load-initial-data:local /home/cceargi/Documents/pipeline-the-game-0.4.0
> npx env-cmd -f .env node scripts/load-initial-data.js

npx: installed 8 in 1.03s
(node:65464) UnhandledPromiseRejectionWarning: Error: Unable to detect a Project Id in the current environment. 
To learn more about authentication and Google APIs, visit: 
https://cloud.google.com/docs/authentication/getting-started
    at /home/cceargi/Documents/pipeline-the-game-0.4.0/node_modules/google-auth-library/build/src/auth/googleauth.js:84:31
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
Caused by: Error
    at WriteBatch.commit (/home/cceargi/Documents/pipeline-the-game-0.4.0/node_modules/@google-cloud/firestore/build/src/write-batch.js:426:23)
    at loadData (/home/cceargi/Documents/pipeline-the-game-0.4.0/scripts/load-initial-data.js:20:15)
    at Object.<anonymous> (/home/cceargi/Documents/pipeline-the-game-0.4.0/scripts/load-initial-data.js:50:14)
    at Module._compile (internal/modules/cjs/loader.js:999:30)
    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 Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)
    at internal/main/run_main_module.js:17:47
(node:65464) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 3)
(node:65464) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

I have followed the correct setup steps in order to complete and both my .env files are in place

rams23 commented 3 years ago

@gilesreece Sorry for the late reply. Are you trying to run it against the emulator or the remote database?

rams23 commented 3 years ago

@gilesreece I reviewed the docs and the env.template and the "GCLOUD_PROJECT" is missing in the instructions, sorry for that. I will update it. If you add it to the root env file it should work

gilesreece commented 3 years ago

Not a problem - I was trying to run the whole product locally, using the emulators: npm run start:emulators

After this step I followed the Docs and tried to initialize the Emulators but that is when I would receive the Above errors. I have gone ahead and created a firebase project with the console and all the environment variables that should be populated are present.

sofusalbertsen commented 3 years ago

@gilesreece thanks for the update. I'm not sure if the problem persists or not? If it is solved, then I'll close the issue.

sofusalbertsen commented 3 years ago

Closed due to inactivity, feel free to reopen.