Unable to open home page! TypeError: Cannot read property 'address' of undefined
roshisoftsol opened this issue · comments
After minor tweaks in package.json file, 'npm run test' finally passed. (Refer to comments of #10)
But getting an error in Chrome console after doing npm run start. Got nothing in terminal though.
Running on macOS High Sierra
ganache is running
truffle test -> passed
npm run test -> passed
Steps in #11 were of no help.
Error in Chrome Console ->
Error retrieving network ID:
TypeError: Cannot read property 'address' of undefined
at http://localhost:3000/static/js/bundle.js:69576:103
From previous event:
at new DrizzleContract (http://localhost:3000/static/js/bundle.js:69575:27)
at Drizzle.getContracts (http://localhost:3000/static/js/bundle.js:69461:58)
at http://localhost:3000/static/js/bundle.js:69442:17
at anonymous
Edit: 07/03/18
I installed ubuntu 16.04 LTS on virtualbox and did a fresh install of drizzle box using link:http://truffleframework.com/boxes/drizzle with one minor change, after doing drizzle unbox I removed the node_modules folder and did 'npm install'. This worked for me. I got the drizzle box up.
@roshisoftsol I fixed this error by switching to localhost:8545 on Metamask. If you changed the port you're running ganache on (e.g. 7545) then you can change metamask to run on that.
I have that same error. I tried switching metamask to localhost:8545 and I still get the error.
Could you please elaborate sajclarke? I can't seem to get this to work.
Thanks in advance.
I have the same error, also tried switching metamask to localhost:8545.
I have another error in Chrome Console:
Error initializing Drizzle.
Then the one from above.
How can I fix it?
Thanks in advance.
I fixed this by deleting all the .json
files under build/contracts
and
truffle compile truffle migrate
Again
Well, it seems it doesn't really fix the issue
#18
"I had the same errors - fixed by changing my Metamask network to: localhost:8545 (the default Ganache port)"
Okay, after 5 hours of trial&error, I found a solution. I guess it is an issue related to incompatible npm packages. This process works for me:
- open a terminal, start with an empty folder
- truffle unbox drizzle
- edit package.json and add to the dependencies section:
- "eth-block-tracker-es5": "^2.3.2"
- "web3": "1.0.0-beta.34"
- npm update (to install the aforementioned packages and to update drizzle and its components to the latest version)
- run in another terminal: ganache-cli -b 3
- truffle compile
- truffle migrate
- npm run start
@ColdDevil this worked for me as well. Thanks for saving me hours of work!
@ColdDevil's solution worked for me too. Probably only need to edit the package.json file.
@ColdDevil thanks, that actually did the trick
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issue has been closed, but can be re-opened if further comments indicate that the problem persists. Feel free to tag maintainers if there is no reply to further comments.