As of v2.4.0, the "browser" and "worker" import conditions are unreachable, because they come after new catchall "import" and "require" conditions. As a result, browser and worker environments are importing the Node.js bundle and breaking on the "node:crypto" import.
▲ [WARNING] The package "node:crypto" wasn't found on the file system but is built into node.
Your Worker may throw errors at runtime unless you enable the "nodejs_compat" compatibility flag. Refer to https://developers.cloudflare.com/workers/runtime-apis/nodejs/ for more details. Imported from:
- ../../../node_modules/.pnpm/ulidx@2.4.0/node_modules/ulidx/dist/node/index.js
✘ [ERROR] Deployment failed!
Failed to publish your Function. Got error: Uncaught Error: No such module "node:crypto".
I can file a PR now with something that should work without breaking what was fixed in #41.
https://unpkg.com/ulidx@2.4.0/package.json
As of v2.4.0, the
"browser"
and"worker"
import conditions are unreachable, because they come after new catchall"import"
and"require"
conditions. As a result, browser and worker environments are importing the Node.js bundle and breaking on the"node:crypto"
import.I can file a PR now with something that should work without breaking what was fixed in #41.