Can't implement Firebase Cloud Message, import error on edge function
Hi, I'm trying to implement FCM on supabase edge functions, and when I call the function on my local env, returns a error.
I try with 2 ways
importing from esm
and import with
and throw with this error:
import { JWT } from 'https://esm.sh/google-auth-library@9' // version based on supabase fcm example
import { JWT } from 'https://esm.sh/google-auth-library@9' // version based on supabase fcm example
runtime has escaped from the event loop unexpectedly: event loop error: TypeError: Cannot convert object to primitive value
at e.isEnabled (https://esm.sh/google-logging-utils@0.0.2/es2022/google-logging-utils.mjs:4:965)
at e.refresh (https://esm.sh/google-logging-utils@0.0.2/es2022/google-logging-utils.mjs:4:1001)
at https://esm.sh/google-logging-utils@0.0.2/es2022/google-logging-utils.mjs:4:1515
runtime has escaped from the event loop unexpectedly: event loop error: TypeError: Cannot convert object to primitive value
at e.isEnabled (https://esm.sh/google-logging-utils@0.0.2/es2022/google-logging-utils.mjs:4:965)
at e.refresh (https://esm.sh/google-logging-utils@0.0.2/es2022/google-logging-utils.mjs:4:1001)
at https://esm.sh/google-logging-utils@0.0.2/es2022/google-logging-utils.mjs:4:1515
npm
import { JWT } from 'npm:google-auth-library@9'
import { JWT } from 'npm:google-auth-library@9'
runtime has escaped from the event loop unexpectedly: event loop error: TypeError: Cannot read properties of undefined (reading 'GOOGLE_SDK_NODE_LOGGING')
at Object.log (file:///var/tmp/sb-compile-edge-runtime/node_modules/localhost/google-logging-utils/0.0.2/build/src/logging-utils.js:356:36)
at Object.<anonymous> (file:///var/tmp/sb-compile-edge-runtime/node_modules/localhost/gcp-metadata/6.1.1/build/src/index.js:52:20)
at Object.<anonymous> (file:///var/tmp/sb-compile-edge-runtime/node_modules/localhost/gcp-metadata/6.1.1/build/src/index.js:409:4)
at Module._compile (node:module:731:34)
at Module._extensions..js (node:module:745:10)
at Module.load (node:module:656:32)
at Module._load (node:module:524:12)
at Module.require (node:module:675:19)
at require (node:module:790:16)
at Object.<anonymous> (file:///var/tmp/sb-compile-edge-runtime/node_modules/localhost/google-auth-library/9.15.1/build/src/auth/googleauth.js:31:21)
runtime has escaped from the event loop unexpectedly: event loop error: TypeError: Cannot read properties of undefined (reading 'GOOGLE_SDK_NODE_LOGGING')
at Object.log (file:///var/tmp/sb-compile-edge-runtime/node_modules/localhost/google-logging-utils/0.0.2/build/src/logging-utils.js:356:36)
at Object.<anonymous> (file:///var/tmp/sb-compile-edge-runtime/node_modules/localhost/gcp-metadata/6.1.1/build/src/index.js:52:20)
at Object.<anonymous> (file:///var/tmp/sb-compile-edge-runtime/node_modules/localhost/gcp-metadata/6.1.1/build/src/index.js:409:4)
at Module._compile (node:module:731:34)
at Module._extensions..js (node:module:745:10)
at Module.load (node:module:656:32)
at Module._load (node:module:524:12)
at Module.require (node:module:675:19)
at require (node:module:790:16)
at Object.<anonymous> (file:///var/tmp/sb-compile-edge-runtime/node_modules/localhost/google-auth-library/9.15.1/build/src/auth/googleauth.js:31:21)
1 Reply
I try importing
firebase-admin
with npm or esm and get the same errors