Michael
Michael
CCConvex Community
Created by Hmza on 7/10/2024 in #general
is resend working for anyone ?
This was supposedly fixed in newer versions of resend and react-email/render (https://github.com/resend/resend-node/issues/381). However, it didn't work for me with resend@4.5.1 + @react-email/render@1.1.2 inside a convex action. I did test and it works fine as a next.js 15 app router backend/api route, so it's expecting something from the environment it's not receiving (maybe Webstreams, just a guess from reading other github issues). What does work for convex actions is jsx-email. Just make sure to put "use node" at the top of both the convex action and the tsx template, or you'll get a lot of these errors:
✘ [ERROR] Could not resolve "path"

node_modules/.pnpm/clean-css@5.3.3/node_modules/clean-css/lib/reader/rewrite-url.js:1:19:
1 │ var path = require('path');
╵ ~~~~~~

The package "path" 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.

✘ [ERROR] Could not resolve "url"

node_modules/.pnpm/clean-css@5.3.3/node_modules/clean-css/lib/reader/rewrite-url.js:2:18:
2 │ var url = require('url');
╵ ~~~~~

The package "url" 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.
See https://docs.convex.dev/functions/runtimes#nodejs-runtime
✘ [ERROR] Could not resolve "path"

node_modules/.pnpm/clean-css@5.3.3/node_modules/clean-css/lib/reader/rewrite-url.js:1:19:
1 │ var path = require('path');
╵ ~~~~~~

The package "path" 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.

✘ [ERROR] Could not resolve "url"

node_modules/.pnpm/clean-css@5.3.3/node_modules/clean-css/lib/reader/rewrite-url.js:2:18:
2 │ var url = require('url');
╵ ~~~~~

The package "url" 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.
See https://docs.convex.dev/functions/runtimes#nodejs-runtime
14 replies
CCConvex Community
Created by Doogibo on 12/13/2024 in #support-community
VERCEL_URL - dynamic Convex env
For posterity, I ended up doing something similar, but since I needed more env vars I did this to avoid the 255 char limit on vercel build instructions:
build_envs.sh
npx convex env set --preview-name $VERCEL_GIT_COMMIT_REF VERCEL_URL $VERCEL_URL && npx convex env set --preview-name $VERCEL_GIT_COMMIT_REF VERCEL_BRANCH_URL $VERCEL_BRANCH_URL && npx convex env set --preview-name $VERCEL_GIT_COMMIT_REF VERCEL_PROJECT_PRODUCTION_URL $VERCEL_PROJECT_PRODUCTION_URL
build_envs.sh
npx convex env set --preview-name $VERCEL_GIT_COMMIT_REF VERCEL_URL $VERCEL_URL && npx convex env set --preview-name $VERCEL_GIT_COMMIT_REF VERCEL_BRANCH_URL $VERCEL_BRANCH_URL && npx convex env set --preview-name $VERCEL_GIT_COMMIT_REF VERCEL_PROJECT_PRODUCTION_URL $VERCEL_PROJECT_PRODUCTION_URL
then my build cmd in the Vercel dashboard is: npx convex deploy --cmd 'npm run build' --preview-run internal.foo.bar && source ./build_envs.sh (I also have a convoluted way to make sure the Clerk webhook replays to all preview envs, the setup for which is what the foo.bar command is standing in for.)
27 replies