Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: Cannot read property 'ws_provider' of undefined #26

Open
Nosok1503 opened this issue Dec 14, 2022 · 8 comments
Open

TypeError: Cannot read property 'ws_provider' of undefined #26

Nosok1503 opened this issue Dec 14, 2022 · 8 comments

Comments

@Nosok1503
Copy link

Nosok1503 commented Dec 14, 2022

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

@Linch1
Copy link
Owner

Linch1 commented Dec 14, 2022

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

@Nosok1503
Copy link
Author

yes, i copy it
image

@Nosok1503
Copy link
Author

I recreate project and now have this error
image

@Linch1
Copy link
Owner

Linch1 commented Dec 14, 2022

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

@Nosok1503
Copy link
Author

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

@Nosok1503
Copy link
Author

Nosok1503 commented Dec 14, 2022

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

@Nosok1503
Copy link
Author

What node version you use?

@Nosok1503
Copy link
Author

Nosok1503 commented Dec 15, 2022

image
imageimage

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

No branches or pull requests

2 participants