Skip to content

fix(cli): avoid global crypto for request ids#89

Merged
yan5xu merged 1 commit intoepiral:mainfrom
MonkeyLeeT:codex/fix-issue-75-node18-crypto
Mar 22, 2026
Merged

fix(cli): avoid global crypto for request ids#89
yan5xu merged 1 commit intoepiral:mainfrom
MonkeyLeeT:codex/fix-issue-75-node18-crypto

Conversation

@MonkeyLeeT
Copy link
Copy Markdown
Contributor

Summary

  • replace the remaining direct crypto.randomUUID() calls with the shared generateId() helper
  • implement generateId() with node:crypto so request IDs work on early Node 18 where global crypto is not reliably available
  • keep the existing engines.node >=18.0.0 contract without changing runtime behavior

Testing

  • pnpm build
  • pnpm test
  • npx -y node@18.0.0 --input-type=module -e "const mod = await import('./packages/shared/dist/index.js'); console.log(JSON.stringify({ id: mod.generateId(), ok: true }));"

Fixes #75

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

错误:crypto is not defined

2 participants