-
I'm currently trying to create a vercel CRON job that executes a transaction every 7 days, but viem relies on the NodeJs crypto, which gives me this error. I initially built the script without React in mind so I didn't use wagmi.
Any ideas how to fix? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 22 replies
-
Hi. Viem does not rely on |
Beta Was this translation helpful? Give feedback.
-
This works: https://viem-edge-fubhy.vercel.app/api/block?block=17043877 Cold start times are significantly faster than with a serverless function. |
Beta Was this translation helpful? Give feedback.
-
This works now with both edge & serverless: https://viem-edge-fubhy.vercel.app/api/edge?block=17043877 https://github.com/fubhy/viem-edge-example The PR is super simple: #375 |
Beta Was this translation helpful? Give feedback.
Solved it!
Looks like it was an issue caused by running it on the Edge, which I just copied.