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
Importing the firebase-admin automatically the browser shows the issue.
// 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
I found a few problems with this issue:
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._
Most helpful comment
Same here when running
vue-cli-service build:Versions:
_Update: never mind,
firebase-adminis not supposed to be run from browser/client-side, only in server-side Node.js environments. Read over that one._