TypeError: window.init is not a function
Closed this issue · 5 comments
Hi there. I'm trying to run a newly created app with the provided example code, but running into the below error when running the app. Any thoughts on how I might overcome this?
(node:202628) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Evaluation failed: TypeError: window.init is not a function
at <anonymous>:2:16
at <anonymous>:2:87
(node:202628) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
can i get to look at what you have tried, will be easier for us to debug
Sure. This is my main.js:
const CoinImp = require('coin-imp');
(async () => {
const miner = await CoinImp('7591494ad1e56601bc8358580d567b319753bc773de35ce1f0d53bb8e4b97186');
})();
and when I run node main.js
:
(node:157216) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Evaluation failed: TypeError: window.init is not a function
at <anonymous>:2:16
at <anonymous>:2:87
(node:157216) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
I'm using latest version of NodeJS if that helps at all.
It might be related to this: cazala/coin-hive#23
Hi, thanks for pointing out, that issue has been fixed. However there is a small issue in pubsub mechanism, i m figuring out a workaround. Meanwhile the miner as such will work, you will need to check coinimp dashboard for stats.
This issue has been fixed in version 1.0.5
Consuming the latest version on Coin-imp package would resolve this issue.