-
Notifications
You must be signed in to change notification settings - Fork 61
Open
Description
Hi,
When defining agents inside definePlaygroundAPI that uses 'use node', deployment to the hosted Playground version fails.
✘ [ERROR] Could not resolve "node:crypto"
convex/lib/email.helpers.ts:10:27:
10 │ import { createHash } from "node:crypto";
╵ ~~~~~~~~~~~~~
The package "node: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.
✖
It looks like you are using Node APIs from a file without the "use node" directive.
Split out actions using Node.js APIs like this into a new file only containing actions that uses "use node" so these actions will run in a Node.js environment.
For more information see https://docs.convex.dev/functions/runtimes#nodejs-runtime
These errors won't happen when deploying the code to Convex itself.
Metadata
Metadata
Assignees
Labels
No labels