nymtech / nym

Nym provides strong network-level privacy against sophisticated end-to-end attackers, and anonymous transactions using blinded, re-randomizable, decentralized credentials.
https://nymtech.net
1.27k stars 234 forks source link

nymproject+mix-fetch-node-commonjs@1.2.4-rc.1 doesn't work with Node v20 (LTS) #4286

Open CedarMist opened 9 months ago

CedarMist commented 9 months ago

Describe the issue I have a test project using Nym mix-fetch with NodeJS.

With Node v18.9.0 it works fine, with Node V20 (LTS release) I get a stacktrace

Expected behaviour Node v20 should work, as it's the LTS release, just as it does with Node v18.

Stack Traces

I get the following error with Node v20 (LTS), it works fine with Node v18 (previous LTS):

     TypeError: Cannot set property crypto of #<Object> which has only a getter
      at /src/demo-nym/backend/node_modules/.pnpm/@nymproject+mix-fetch-node-commonjs@1.2.4-rc.1/node_modules/@nymproject/mix-fetch-node-commonjs/web-worker-0.js:14481:20
      at Object.<anonymous> (node_modules/.pnpm/@nymproject+mix-fetch-node-commonjs@1.2.4-rc.1/node_modules/@nymproject/mix-fetch-node-commonjs/web-worker-0.js:17882:3)
      at Module._compile (node:internal/modules/cjs/loader:1376:14)
      at Module._extensions..js (node:internal/modules/cjs/loader:1435:10)
      at Module.load (node:internal/modules/cjs/loader:1207:32)
      at Module._load (node:internal/modules/cjs/loader:1023:12)
      at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:135:12)
      at MessagePort.<anonymous> (node:internal/main/worker_thread:185:26)
      at [nodejs.internal.kHybridDispatch] (node:internal/event_target:814:20)
      at exports.emitMessage (node:internal/per_context/messageport:23:28)

Steps to Reproduce https://gist.github.com/CedarMist/611a54a2a6ea3377278ec4b4167b5fd8

github-actions[bot] commented 9 months ago

Thank you for raising this issue

tommyv1987 commented 9 months ago

Yes, we're aware of this, and we will look to fix this in the near future, but in the interim we suggest using v18.*, we're scoping out the roadmap to allocate more dev time to the SDK shortly