makerdao / multicall.js

Multicall.js: A JavaScript blockchain state management library for dapps
MIT License
422 stars 97 forks source link

SyntaxError: Unexpected token { #22

Open tpmccallum opened 4 years ago

tpmccallum commented 4 years ago

When following the instructions I get the following error running yarn example

import { createWatcher } from '@makerdao/multicall';
       ^
SyntaxError: Unexpected token {

I resolved this by using the following code instead

var mc = require("@makerdao/multicall")
//snip
const watcher = mc.createWatcher( 
// snip
fryheid commented 3 years ago

You can also use const { createWatcher} = require('@makerdao/multicall') instead