unenv icon indicating copy to clipboard operation
unenv copied to clipboard

`createHmac` (from `node:crypto`) is not implemented for nodeless targets

Open zou-yu opened this issue 1 year ago • 1 comments

Environment

nodejs20 "nuxt": "^3.12.3", wrangler:

compatibility_date = "2024-07-01"
compatibility_flags = ["nodejs_compat"]

Reproduction

Just enable nodejs-compat in wrangler and using cloudlfare_module preset, you will get the same error: [unenv] crypto.createHmac is not implemented yet!

Describe the bug

Cannot use createHmac in cloudflare worker with cloudflare_module preset, got error: [unenv] crypto.createHmac is not implemented yet! but createHmac is supported in cloudflare worker: https://developers.cloudflare.com/workers/runtime-apis/nodejs/crypto/

Additional context

No response

Logs

[unenv] crypto.createHmac is not implemented yet!

zou-yu avatar Aug 01 '24 09:08 zou-yu

would love to see this implemented, the only thing stopping me from using it with lucia auth.

Flowko avatar Aug 26 '24 18:08 Flowko

@zou-yu @Flowko this is now implemented (natively) in cloudflare.

@pi0 not sure if you want to close this issue or leaving it open for nodeless

vicb avatar Oct 11 '24 16:10 vicb

@vicb

  1. unenv support is not limited to cloudflare
  2. even for cloudflare we cannot upgrade to unenv v2 for Nitr/Nuxt because of the blockers I shared with you

This issue is not solved at least for original reported problem.

pi0 avatar Oct 11 '24 21:10 pi0

Thanks for the clarification @pi0!

  1. unenv support is not limited to cloudflare

Yep, that's why I asked about closing this PR.

  1. even for cloudflare we cannot upgrade to unenv v2 for Nitr/Nuxt because of the blockers I shared with you

I thought the reported issue was solved. I didn't consider v1 vs v2.

vicb avatar Oct 12 '24 07:10 vicb

any updates on this issue? would also love to see this implemented. thank you!

radum2o18 avatar Oct 30 '24 19:10 radum2o18

Moving to #419 -- it will be available soon for Nuxt/Nitro with cloudflare deployments

pi0 avatar Feb 06 '25 19:02 pi0