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

web3-core-method.umd.js?b3db:226 Uncaught (in promise) TypeError: Duplicated method __ob__. This method is defined as RPC call and as Object method. #2281

Closed
mjdietzx opened this issue Jan 31, 2019 · 13 comments
Labels
2.x 2.0 related issues Enhancement Includes improvements or optimizations Stale Has not received enough activity

Comments

@mjdietzx
Copy link

All issues which aren't created with this template will get immediately closed.

Expected behavior

const contract = web3js.eth.Contract(abi, address);

should (and used to) return a contract instance

Actual behavior

instead it throws this error
web3-core-method.umd.js?b3db:226 Uncaught (in promise) TypeError: Duplicated method __ob__. This method is defined as RPC call and as Object method.

Steps to reproduce the behavior

  1. [First step]
  2. [Second step]
  3. [and so on...]

Error Logs

web3-core-method.umd.js?b3db:226 Uncaught (in promise) TypeError: Duplicated method __ob__. This method is defined as RPC call and as Object method.
    at Object.get (web3-core-method.umd.js?b3db:226)
    at observe (vue.runtime.esm.js?2b0e:961)
    at defineReactive$$1 (vue.runtime.esm.js?2b0e:1002)
    at Observer.walk (vue.runtime.esm.js?2b0e:914)
    at new Observer (vue.runtime.esm.js?2b0e:902)
    at observe (vue.runtime.esm.js?2b0e:970)
    at defineReactive$$1 (vue.runtime.esm.js?2b0e:1002)
    at Observer.walk (vue.runtime.esm.js?2b0e:914)
    at new Observer (vue.runtime.esm.js?2b0e:902)
    at observe (vue.runtime.esm.js?2b0e:970)

Versions

[NPM, Node, Web3.js, OS, device...]

most recent versions of npm, node, web3.js (beta 41). in browser (Chrome with metamask)

@nivida nivida added the Bug Addressing a bug label Jan 31, 2019
@devedse
Copy link

devedse commented Feb 1, 2019

I'm encountering the same issue with version higher then beta 37. With beta 41 I got all kinds of typescript errors, so no idea what's going on there.

@devedse
Copy link

devedse commented Feb 1, 2019

When I downgrade to =beta37 then it works again.

@nivida
Copy link
Contributor

nivida commented Feb 4, 2019

Thanks for submitting this issue!

I've tested it and can't reproduce this error. The thrown error has to come from somewhere else then on the creation of a Contract object. Could you provide further details about when this exactly happens?

@nivida nivida added more information needed and removed Bug Addressing a bug labels Feb 4, 2019
@kvhnuke
Copy link

kvhnuke commented Feb 5, 2019

This is due to vuejs attaching __ob__ to object as an oberserver, you should skip targets that starts with $ or _ https://011.vuejs.org/api/options.html

@nivida nivida added Enhancement Includes improvements or optimizations and removed more information needed labels Feb 6, 2019
@nivida
Copy link
Contributor

nivida commented Feb 6, 2019

@kvhnuke Thanks for the clarification! will check that.

@vedmant
Copy link

vedmant commented Feb 6, 2019

I have the same issue, and yes, I use Vue.js.

@mjdietzx
Copy link
Author

We are using Vue.js as well. Our workaround has been to stick with =beta37. Will upgrade to master once this is fixed

@vedmant
Copy link

vedmant commented Feb 21, 2019

Current workaround I used is to use Object.freeze() on the contract that's added to vuex store.

@jamesmorgan
Copy link

jamesmorgan commented Feb 24, 2019

I get this but freezing does not seem to help. Also using Vue

@pertsev
Copy link

pertsev commented Apr 4, 2019

Have the same issue. But I don't even put the contract instance to the state. Just creating an instance by a getter. Any advices?

env:

  1. vue + nuxt
  2. web3@1.0.0-beta.51

@nivida nivida added the 2.x 2.0 related issues label Jun 20, 2019
@chriszer
Copy link

and I'm using react what about on react?

@nivida
Copy link
Contributor

nivida commented Oct 13, 2019

The proxies who occur this problem will get removed in the 2.x branch as soon as I refactored the public API for BatchRequest. The ES6 Proxy object was required because of the parameters handling for BatchRequests. The solution with the Proxy object is the clean version to handle it without having N bindings.

@github-actions
Copy link

github-actions bot commented Jul 4, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions

@github-actions github-actions bot added the Stale Has not received enough activity label Jul 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.x 2.0 related issues Enhancement Includes improvements or optimizations Stale Has not received enough activity
Projects
None yet
Development

No branches or pull requests

8 participants