cosmos / cosmjs

The Swiss Army knife to power JavaScript based client solutions ranging from Web apps/explorers over browser extensions to server-side clients like faucets/scrapers.
https://cosmos.github.io/cosmjs/
Apache License 2.0
636 stars 324 forks source link

SyntaxError: Unexpected token '.' while deploying faucet service #1574

Open gunanshuCN opened 3 months ago

gunanshuCN commented 3 months ago

While deploying the faucet service for a chain on my VM, I faced the following issue:

/home/skc/faucet/node_modules/@cosmjs/crypto/build/pbkdf2.js:60
    let subtle = globalThis?.crypto?.subtle;
                            ^

SyntaxError: Unexpected token '.'
    at wrapSafe (internal/modules/cjs/loader.js:915:16)
    at Module._compile (internal/modules/cjs/loader.js:963:27)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
    at Module.load (internal/modules/cjs/loader.js:863:32)
    at Function.Module._load (internal/modules/cjs/loader.js:708:14)
    at Module.require (internal/modules/cjs/loader.js:887:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (/home/skc/faucet/node_modules/@cosmjs/crypto/build/bip39.js:5:18)
    at Module._compile (internal/modules/cjs/loader.js:999:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)

I have tried node version v16.16.0 and v20.11.0 I tried it with yarn version 1.22.19 and 3.6.3