Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Parity.js relying on global fetch #3471

Closed
tomusdrw opened this issue Nov 16, 2016 · 1 comment
Closed

Parity.js relying on global fetch #3471

tomusdrw opened this issue Nov 16, 2016 · 1 comment
Assignees
Labels
F2-bug 🐞 The client fails to follow expected behavior. M6-rpcapi 📣 RPC API.

Comments

@tomusdrw
Copy link
Collaborator

const Api = require('@parity/parity.js').Api;
const transport = new Api.Transport.Http('http://localhost:8545');
const api = new Api(transport);

api.eth
  .coinbase()
  .then((coinbase) => {
    console.log('The coinbase is', coinbase);
  });

=======================================================

/home/kyroy/node_modules/@parity/parity.js/library.js:3
[...]

ReferenceError: fetch is not defined
    at e.value (/home/kyroy/node_modules/@parity/parity.js/library.js:3:15183)
    at e.r._pollConnection (/home/kyroy/node_modules/@parity/parity.js/library.js:3:14669)
    at new e (/home/kyroy/node_modules/@parity/parity.js/library.js:3:14760)
    at Object.<anonymous> (/home/kyroy/github/offchain-computation-verification/contracts/mm_single_client_parity.js:2:17)
    at Module._compile (module.js:573:32)
    at Object.Module._extensions..js (module.js:582:10)
    at Module.load (module.js:490:32)
    at tryModuleLoad (module.js:449:12)
    at Function.Module._load (module.js:441:3)
    at Module.runMain (module.js:607:10)

Should probably use some kind of https://github.com/matthew-andrews/isomorphic-fetch instead.

@tomusdrw tomusdrw added F2-bug 🐞 The client fails to follow expected behavior. M6-rpcapi 📣 RPC API. labels Nov 16, 2016
@jacogr
Copy link
Contributor

jacogr commented Nov 16, 2016

Definitely an issue, the build should bring in these dependencies into the WebPack bundle.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
F2-bug 🐞 The client fails to follow expected behavior. M6-rpcapi 📣 RPC API.
Projects
None yet
Development

No branches or pull requests

3 participants