noob saibot
noob saibot10mo ago

Unable to use a node package

I am creating an http action which imports the node package twilio. I'm getting a series of errors for different packages used by twilio, (e.g crypto, stream,) not found on the file system but built into node:
The package "crypto" wasn't found on the file system but is built into node. Are you trying to
bundle for node? You can use "platform: 'node'" to do that, which will remove this error.
The package "crypto" wasn't found on the file system but is built into node. Are you trying to
bundle for node? You can use "platform: 'node'" to do that, which will remove this error.
Even when I add use node on top of the action file. I'm still getting this error.
2 Replies
sshader
sshader10mo ago
Hi we don't currently support HTTP actions in node, but perhaps you could put the parts that use the twilio package into an action (which does work with "use node") and call it from the HTTP action using runAction This article https://stack.convex.dev/stripe-with-convex has an example of doing this
Wake up, you need to make money! (Add Stripe to your product)
If you’re building a full-stack app, chances are you’ll want some of your users to pay you for the service you provide. How to use Stripe with Convex ...
noob saibot
noob saibotOP10mo ago
@sshader thanks. This article helped me to solve the issue.

Did you find this page helpful?