Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

createPost Issue: stuck at loading screen #1

Open
Madgeniusblink opened this issue Dec 26, 2019 · 6 comments
Open

createPost Issue: stuck at loading screen #1

Madgeniusblink opened this issue Dec 26, 2019 · 6 comments

Comments

@Madgeniusblink
Copy link

Madgeniusblink commented Dec 26, 2019

Hi I was wondering why after creating the post the state sets to loading but never goes back to false(not loading)?

I try to debug it but no luck... I do get this error when I use the react chrome extension to check the state:

web3-core-method.umd.js:696 Uncaught TypeError: Duplicated method constructor. This method is defined as RPC call and as Object method.
    at Object.get (web3-core-method.umd.js:696)
    at s (backend.js:1)
    at c (backend.js:1)
    at c (backend.js:1)
    at c (backend.js:1)
    at h (backend.js:1)
    at Object.inspectElement (backend.js:6)
    at t.<anonymous> (backend.js:6)
    at t.r.emit (backend.js:6)
    at backend.js:30
    at t (backend.js:6)

Any idea what it could be?
Here is my repo link: https://github.com/Madgeniusblink/SocialNetwork-Dapp

It seems that it also happens after user tips.
Overall the application works just fine no issues there.. it just gets stuck in the loading state.. and I have no idea how to fix that.

Thank you in advance for taking a look at the issue!

@johnsin
Copy link

johnsin commented Jan 3, 2020

Yeah, I am running into the same problem.. It appears that there is something funny with the app.js.

this.state.socialNetwork.methods.createPost(content).send({ from: this.state.account }) .once('receipt', (receipt) => { console.log("Does This work"); this.setState({ loading: false }) })

this.state.socialNetwork.methods.tipPost(id).send({ from: this.state.account, value: tipAmount }) .once('receipt', (receipt) => { this.setState({ loading: false }) })

It seems like the ".once" function isn't firing, or nothing is being returned. I'm wondering if the web3.js updated something that blew this up.

@Madgeniusblink
Copy link
Author

@johnsin weird probably... I will try to work on it this week and see if I can get it to work the right way... Thank you for taking a look at the issue as well!

@johnsin
Copy link

johnsin commented Jan 7, 2020

@Madgeniusblink
I'm starting here.. https://web3js.readthedocs.io/en/v1.2.0/web3-eth-contract.html#once..

But what is odd is that his code worked, and ours didn't. So I am wondering if they updated the Web3 lib and when we pulled it down from out package.json.. we got a newer version that handles the .once/event/callback stuff differently.

I haven't tested anything yet... but this is what I am deducing the bug down to. I'm just lazy right now. ;)

If I get motivated.. ill update again!

@Madgeniusblink
Copy link
Author

hahaha, thank you! and I will as well try it in next couple of days if you haven't gotten to it

@var-rohit
Copy link

@Madgeniusblink @johnsin I have corrected the issue, most probably it was a version mismatch and have uploaded the project on https://github.com/var-rohit/Ethereum-DApp-using-React

@Legitao
Copy link

Legitao commented Mar 11, 2020

I updated web3 to the latest 1.2.6 and it worked

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants