chuckbergeron / etherplate

🔗 Use this to make your next Ethereum DApp w/ React (& Router), Redux, Bulma & OpenZeppelin ERC721
https://chuckbergeron.io
Other
78 stars 34 forks source link

truffle compile javascript error #13

Closed SvenMeyer closed 6 years ago

SvenMeyer commented 6 years ago
truffle compile

/home/sum/DEV/VehicleLog/node_modules/truffle-hdwallet-provider/node_modules/web3/lib/web3/errors.js:35
        return new Error(message);
               ^
Error: Invalid JSON RPC response: ""
    at Object.InvalidResponse (/home/sum/DEV/VehicleLog/node_modules/truffle-hdwallet-provider/node_modules/web3/lib/web3/errors.js:35:16)
    at XMLHttpRequest.request.onreadystatechange (/home/sum/DEV/VehicleLog/node_modules/truffle-hdwallet-provider/node_modules/web3/lib/web3/httpprovider.js:115:32)
    at XMLHttpRequestEventTarget.dispatchEvent (/home/sum/DEV/VehicleLog/node_modules/xhr2/lib/xhr2.js:64:18)
    at XMLHttpRequest._setReadyState (/home/sum/DEV/VehicleLog/node_modules/xhr2/lib/xhr2.js:354:12)
    at XMLHttpRequest._onHttpRequestError (/home/sum/DEV/VehicleLog/node_modules/xhr2/lib/xhr2.js:544:12)
    at ClientRequest.<anonymous> (/home/sum/DEV/VehicleLog/node_modules/xhr2/lib/xhr2.js:414:24)
    at ClientRequest.emit (events.js:182:13)
    at Socket.socketErrorListener (_http_client.js:382:9)
    at Socket.emit (events.js:182:13)
    at emitErrorNT (internal/streams/destroy.js:82:8)
SvenMeyer commented 6 years ago

Just tried it again today, exactly following the documentation.

$ node --version
v10.9.0
$ npm --version
6.4.0

$ direnv allow
$ mkdir .ganache
$ truffle compile

/home/sum/DEV/ep180820/node_modules/truffle-hdwallet-provider/node_modules/web3/lib/web3/errors.js:35
        return new Error(message);
               ^
Error: Invalid JSON RPC response: ""
    at Object.InvalidResponse (/home/sum/DEV/ep180820/node_modules/truffle-hdwallet-provider/node_modules/web3/lib/web3/errors.js:35:16)
    at XMLHttpRequest.request.onreadystatechange (/home/sum/DEV/ep180820/node_modules/truffle-hdwallet-provider/node_modules/web3/lib/web3/httpprovider.js:115:32)
    at XMLHttpRequestEventTarget.dispatchEvent (/home/sum/DEV/ep180820/node_modules/xhr2/lib/xhr2.js:64:18)
    at XMLHttpRequest._setReadyState (/home/sum/DEV/ep180820/node_modules/xhr2/lib/xhr2.js:354:12)
    at XMLHttpRequest._onHttpRequestError (/home/sum/DEV/ep180820/node_modules/xhr2/lib/xhr2.js:544:12)
    at ClientRequest.<anonymous> (/home/sum/DEV/ep180820/node_modules/xhr2/lib/xhr2.js:414:24)
    at ClientRequest.emit (events.js:182:13)
    at Socket.socketErrorListener (_http_client.js:391:9)
    at Socket.emit (events.js:182:13)
    at emitErrorNT (internal/streams/destroy.js:82:8)
SvenMeyer commented 6 years ago

Looks like as if during compile a request is being made to Infura (why already at compile time?) I found out that the environment setup did not work (on my end) .

source .envrc

solved the problem.

chuckbergeron commented 6 years ago

That's strange that a request would be made to Infura during contract compilation. I just received that Invalid JSON RPC error when I was setting this up on my new laptop and it was because I didn't have the ganache server running locally.

Happy to hear you were able to fix it!