truffle-box / drizzle-box

This box comes with everything you need to start using smart contracts from a react app with Drizzle. It includes drizzle, drizzle-react and drizzle-react-components to give you a complete overview of Drizzle's capabilities.
MIT License
312 stars 71 forks source link

Unable to open home page! TypeError: Cannot read property 'address' of undefined #15

Closed roshisoftsol closed 5 years ago

roshisoftsol commented 6 years ago

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.

sajclarke commented 6 years ago

@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.

pablog12 commented 6 years ago

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.

jkosior commented 6 years ago

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.

moshebeeri commented 6 years ago

Having the same issue image

wangki commented 6 years ago

I fixed this by deleting all the .json files under build/contracts and truffle compile truffle migrate

Again

wangki commented 6 years ago

Well, it seems it doesn't really fix the issue

wangki commented 6 years ago

https://github.com/truffle-box/drizzle-box/issues/18 "I had the same errors - fixed by changing my Metamask network to: localhost:8545 (the default Ganache port)"

ColdDevil commented 6 years ago

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:

awrgold commented 6 years ago

@ColdDevil this worked for me as well. Thanks for saving me hours of work!

gdbjohnson commented 6 years ago

@ColdDevil's solution worked for me too. Probably only need to edit the package.json file.

briankostar commented 5 years ago

@ColdDevil thanks, that actually did the trick

stale[bot] commented 5 years ago

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.

stale[bot] commented 5 years ago

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.