WeChartWeb3 icon indicating copy to clipboard operation
WeChartWeb3 copied to clipboard

TypeError: Cannot read property 'ws_provider' of undefined

Open Nosok1503 opened this issue 3 years ago • 8 comments

When I trying run, error arises. P.S. I install full-node provider https://github.com/self-node-official and it run successfully, also I do all Setup steps, ws and http URL added node --version v12.22.12 npm --version 6.14.16 Can you help me?

npm run scraper

[email protected] scraper /root/WeChartWeb3 node ./workers/updater/master.js

WARNING: NODE_ENV value of 'staging' did not match any deployment config file names. WARNING: See https://github.com/node-config/node-config/wiki/Strict-Mode WARNING: No configurations found in configuration directory:/root/WeChartWeb3/config WARNING: To disable this warning set SUPPRESS_NO_CONFIG_WARNING in the environment. /root/WeChartWeb3/workers/lib/web3.js:6 web3_wss.setProvider(new Web3.providers.WebsocketProvider( scraperConfig[process.env.CHAIN_ID].ws_provider )); ^

TypeError: Cannot read property 'ws_provider' of undefined at Object. (/root/WeChartWeb3/workers/lib/web3.js:6:96) at Module._compile (internal/modules/cjs/loader.js:999:30) 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. (/root/WeChartWeb3/workers/lib/block.listner.js:1:33) at Module._compile (internal/modules/cjs/loader.js:999:30) 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. (/root/WeChartWeb3/workers/lib/scrape.block.stream.js:17:23) at Module._compile (internal/modules/cjs/loader.js:999:30) npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! [email protected] scraper: node ./workers/updater/master.js npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the [email protected] scraper script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in: npm ERR! /root/.npm/_logs/2022-12-14T10_45_38_579Z-debug.log

Screenshot_1 image

Nosok1503 avatar Dec 14 '22 10:12 Nosok1503

have you created also the .env from the .env.example inside the repo? it seems that process.env.CHAIN_ID ( used inside workers/lib/web3.js ) is missing

Linch1 avatar Dec 14 '22 12:12 Linch1

yes, i copy it image

Nosok1503 avatar Dec 14 '22 12:12 Nosok1503

I recreate project and now have this error image

Nosok1503 avatar Dec 14 '22 12:12 Nosok1503

Which version of node are you using ? The ?. syntax should be aviable in most recent versions

Linch1 avatar Dec 14 '22 13:12 Linch1

node --version v12.22.12 npm --version 6.14.16

Nosok1503 avatar Dec 14 '22 13:12 Nosok1503

I update my node version and right now have this type of error image

Nosok1503 avatar Dec 14 '22 14:12 Nosok1503

What node version you use?

Nosok1503 avatar Dec 15 '22 15:12 Nosok1503

image imageimage

Nosok1503 avatar Dec 15 '22 16:12 Nosok1503