processinfo no longer works on Node.js <20

Open
#5 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
55/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
javascript, node.js
Domain
devtools

Research direction

Reproduce the failure on Node.js 16 or 18 through @tapjs/processinfo's ESM --import loader hook, then inspect the uuid.v4() call and uuid's dist-node/v4.js reference to the bare crypto global. Done means processinfo works on the supported pre-20 Node.js versions without the ReferenceError.

Written by the indexing model from the issue text.

Description

  1. @tapjs/processinfo@3.1.12 now depends on uuid@14.0.0
  2. uuid@14's node build (dist-node/v4.js) references the bare global crypto:
    if (!buf && !options && crypto.randomUUID) {   // <-- global, not import('node:crypto')
    
  3. @tapjs/processinfo calls uuid.v4() from its ESM --import loader hook (the way we use it, at least.)
  4. On Node.js versions before 20, the WebCrypto global isn't exposed unflagged, so it throws ReferenceError: crypto is not defined

Node.js 20+ have the global, so they pass. Tap seems to officially supports Node.js 16+, but this makes it break on 16 and 18 as soon as Tap pulls in proccessinfo.

Dominant language
JavaScript
Stars
7
Forks
4
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from tapjs/processinfo

All issues in tapjs/processinfo

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.