Firebase-admin-node: Issue to import the firebase admin sdk

Created on 13 Oct 2018  路  3Comments  路  Source: firebase/firebase-admin-node

Hi, I am developing an application in nuxtjs and I need to use the firebase-admin to validate the tokenId of authenticated users. I have installed the firebase-admin with out problem but when i import it I have an issue. I have dont found how to fix it.

Describe your environment

  • Operating System version: Node.js
  • Firebase SDK version: 6.0.0
  • Firebase Product: Firebase admin SDK

[REQUIRED] Step 3: Describe the problem

Importing the firebase-admin automatically the browser shows the issue.

Relevant Code:

// TODO(you): code here to reproduce the problem

WARNING Compiled with 4 warnings
20:30:20 warning in ./node_modules/grpc/src/grpc_extension.js

Critical dependency: the request of a dependency is an expression

warning in ./node_modules/grpc/node_modules/node-pre-gyp/lib/pre-binding.js

Critical dependency: the request of a dependency is an expression

warning in ./node_modules/grpc/node_modules/node-pre-gyp/lib/util/versioning.js

Critical dependency: the request of a dependency is an expression

warning in ./node_modules/hash-stream-validation/index.js

Module not found: Error: Can't resolve 'fast-crc32c' in 'C:\Users\ARSENIO\Desktop\Development\nuxt\project4\node_modules\hash-stream- validation'

ERROR Failed to compile with 38 errors
20:30:20 These dependencies were not found:

child_process in ./node_modules/google-auth-library/build/src/auth/googleauth.js, ./node_modules/grpc/node_modules/detect-libc/lib/detect-libc.js
fs in ./node_modules/@google-cloud/storage/src/file.js, ./node_modules/@google-cloud/storage/src/bucket.js and 34 others
To install them, you can run: npm install --save child_process fs

Most helpful comment

Same here when running vue-cli-service build:

 WARNING  Compiled with 4 warnings2:19:27 PM

 warning  in ./node_modules/google-gax/node_modules/grpc/src/grpc_extension.js

Critical dependency: the request of a dependency is an expression

 warning  in ./node_modules/google-gax/node_modules/grpc/node_modules/node-pre-gyp/lib/pre-binding.js

Critical dependency: the request of a dependency is an expression

 warning  in ./node_modules/google-gax/node_modules/grpc/node_modules/node-pre-gyp/lib/util/versioning.js

Critical dependency: the request of a dependency is an expression

 warning  in ./node_modules/hash-stream-validation/index.js

Module not found: Error: Can't resolve 'fast-crc32c' in 'node_modules/hash-stream-validation'

Versions:

[email protected]
[email protected]
[email protected]
[email protected]

macOS Mojave

_Update: never mind, firebase-admin is not supposed to be run from browser/client-side, only in server-side Node.js environments. Read over that one._

All 3 comments

I found a few problems with this issue:

  • I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.
  • This issue does not seem to follow the issue template. Make sure you provide all the required information.

I provided the error that the console shows and the version of sdk that I am using.

Same here when running vue-cli-service build:

 WARNING  Compiled with 4 warnings2:19:27 PM

 warning  in ./node_modules/google-gax/node_modules/grpc/src/grpc_extension.js

Critical dependency: the request of a dependency is an expression

 warning  in ./node_modules/google-gax/node_modules/grpc/node_modules/node-pre-gyp/lib/pre-binding.js

Critical dependency: the request of a dependency is an expression

 warning  in ./node_modules/google-gax/node_modules/grpc/node_modules/node-pre-gyp/lib/util/versioning.js

Critical dependency: the request of a dependency is an expression

 warning  in ./node_modules/hash-stream-validation/index.js

Module not found: Error: Can't resolve 'fast-crc32c' in 'node_modules/hash-stream-validation'

Versions:

[email protected]
[email protected]
[email protected]
[email protected]

macOS Mojave

_Update: never mind, firebase-admin is not supposed to be run from browser/client-side, only in server-side Node.js environments. Read over that one._

Was this page helpful?
0 / 5 - 0 ratings