Cannot set property 'contracts' of undefined
Pony-Unicorn opened this issue · 8 comments
import ScatterJS from 'scatterjs-core';
import ScatterEOS from 'scatterjs-plugin-eosjs2';
import { JsonRpc, Api } from 'eosjs';
ScatterJS.plugins(new ScatterEOS());
const network = ScatterJS.Network.fromJson({
blockchain: 'eos',
protocol: 'https',
host: 'jungle2.cryptolions.io',
port: 443,
chainId: 'e70aaab8997e1dfce58fbfac80cbbb8fecec7b99cf982a9444273cbc64c41473'
});
const rpc = new JsonRpc(network.fullhost());
ScatterJS.connect('yipuio', { network }).then(connected => {
if (!connected) return console.error('no scatter');
// Api (eosjs-api.js:248) 'contracts' of undefined
const eos = ScatterJS.eos(network, Api, { rpc, beta3: true });
console.log(eos);
});
Are you trying to use the Scatter Extension?
yes !
So, that definitely isn't going to work :P
The extension does not support eosjs2 and likely never will as it has been deprecated for about 6 months now and no work is being done on it citing security concerns.
Grab desktop from https://get-scatter.com and all will be well.
what that meaning? cannot use scatter chrome extension?
only desktop version?
The chrome extension has been deprecated for almost a year now, and does not support newer things like eosjs2
Using desktop also get this issue.
Using desktop also get this issue.
I had the same issue. It is caused due I used old scatterjs-plugin-eosjs while my eosjs version was 20.0.0.
Doc says:
// eosjs
npm i -S scatterjs-plugin-eosjs // For using eosjs@16.0.9 and below
npm i -S scatterjs-plugin-eosjs2 // For using eosjs@beta and up
I replaced scatterjs-plugin-eosjs with scatterjs-plugin-eosjs2 and now everything works
Also, those are deprecated :)
Should be:
npm i -S @scatterjs/eosjs2