Error while using Plunk with Convex
Hi guys, I am getting the following error while trying to use Plunk with Convex (I am currently migrating from Resend):
8 Replies
What does your code look like? Try to move the Plunk library call inside your action (instead of having it at the module scope, which the error suggests is happening now).
Sorry for reposting here. But the Plunk team already replied before: This is because our NodeJS package is still a classic module. I recommend building your own wrapper function using the API for now!
What does "classic module" mean. You can also try using Node actions:
https://docs.convex.dev/functions/actions#calling-third-party-apis-and-using-npm-packages
Actions | Convex Developer Hub
Actions can call third party services to do things such as processing a payment
Yes, I am using it in a action with
'use node';
I creates this file called context.ts so I can reuse it.
Just to note I was using Resend the similiar way and it worked.
Will try soon.
Moving the whole
const plunk = new Plunk("Your secret key");
seems to work.Actually not, I get these errors in Convex logs now:
Will try soon.
It means CommonJS module.