-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue when using in Vercel edge functions #56
Comments
This is a known issue due to a dependency on noblehashes. We can open an issue there and try to get it addressed, or find an alternative, security-audited Sha-3 implementation to depend on. (Maybe one used by the Ethereum Web3 stuff?). I'm leaning this way anyway due to noble's dependency on TextEncoder APIs that are not available in some environments. |
fwiw it works with no issue in my nuxt3 project deployed to vercel edge functions |
I tracked down an error using cuid2 to this issue on my docker image/node version. Any progress removing this dependency? |
Perhaps something like Oslo's crypto module might be a good option, as it seems to be in the same spirit as @noble/hashes: https://github.com/oslo-project/crypto |
I'm developing a library ( https://github.com/lgrammel/ai-utils.js ) and was using cuid2. However, it throws the following error when using it in Vercel edge functions:
It's most likely caused by the limited API availability in edge functions ( see https://nextjs.org/docs/messages/node-module-in-edge-runtime ) and could be solved by configuring webpack. However, since I'm developing a library I don't want to expose my users to this.
I've switched to nanoid v3 for the time being, which seems to work w/o issues in that environment, but I'd like to switch back to cuid2 in case this issue is fixable.
The text was updated successfully, but these errors were encountered: