Error: Not implemented: crypto.Sign
The following is a supabase edge-function that is meant to send a post request to Firebase Cloud Messaging. However, it throws the error above and I am not sure why this is happening or how to solve it.
This is the guide that I follow: https://supabase.com/docs/guides/functions/examples/push-notifications?platform=fcm
Sending Push Notifications | Supabase Docs
Send Push Notifications to your React Native iOS and Android apps using Expo.
2 Replies
I wasn't able to find the answer to your question in the official Deno documentation. However, based on the error message you've provided, it seems that the
crypto.Sign
functionality you're trying to use is not implemented in the Deno standard library's Node compatibility layer.
The error message indicates that the Sign
class from Node's crypto
module is not available in Deno's standard library. This is likely because Deno has its own set of cryptographic functions and does not fully support Node's crypto
module.
As the advice is not based on the Deno documentation, please double-check the accuracy of the advice given. One possible solution might be to look for a Deno-native module that provides the cryptographic functionality you need, or to use Deno's built-in Web Crypto API if it suits your use case.
Since you are working with Supabase edge functions and Firebase Cloud Messaging, you might need to find an alternative way to implement the signing process that is compatible with Deno's available APIs or third-party modules designed for Deno.