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

DOMException Failed to execute 'postMessage' on 'Window' #6080

Open
bicep opened this issue Jan 31, 2019 · 20 comments

Comments

Projects
None yet
@bicep
Copy link

commented Jan 31, 2019

I'm aware of #1280 (I'm running local server on port 3000) and #5333 (I'm not so sure what this is but it was fixed?). Apologies in advance if this was covered already, I cant seem to find it.

Describe the bug
A clear and concise description of what the bug is.

I've set up web3 so that I'm using the latest version of web3 (1.0.0 beta 43) that sets the provider from the metamask's web3.

const provider = window.web3.currentProvider; provider.enable(); const web3 = new Web3(provider);

I've currently deployed a contract on Rinkeby and am trying to get a simple public variable called manager using contract.methods.manager.call(), but I'm getting this DOMException in Chrome:

screen shot 2019-01-31 at 12 01 47 am

@YukiOta

This comment has been minimized.

Copy link

commented Jan 31, 2019

I have a same issue... Any solutions for this?
I posted stack exchange here

@phamhieu

This comment has been minimized.

Copy link

commented Jan 31, 2019

I fixed this issue by running npm install. I'm using web3:1.0.0-beta.37

@chentschel

This comment has been minimized.

Copy link

commented Jan 31, 2019

Same issue with web3@beta.41 .Solved installing web3:1.0.0-beta.37

@YukiOta

This comment has been minimized.

Copy link

commented Feb 1, 2019

Solved by installing web3:1.0.0-beta.37

Thank you so much!
@phamhieu @chentschel

@rdig rdig referenced this issue Feb 7, 2019

Merged

Fix latest web3 beta breaking metamask module #202

4 of 4 tasks complete
@serapath

This comment has been minimized.

Copy link

commented Feb 28, 2019

Not sure, but i have the same issue https://play.ethereum.org/play-editor/
It seems to work when running on localhost during development with a dev server.

The error happens when you DEPLOY the contract

Any clue what this is about?

@ninabreznik

This comment has been minimized.

Copy link

commented Feb 28, 2019

Any news about how to resolve this issue?

@ninabreznik

This comment has been minimized.

Copy link

commented Mar 3, 2019

screenshot_2019-03-03_07-05-05
screenshot_2019-03-03_07-03-41

@szerintedmi

This comment has been minimized.

Copy link

commented Mar 4, 2019

Getting the same with beta47 :(

@ninabreznik

This comment has been minimized.

Copy link

commented Mar 4, 2019

I also get this now with another Dapp. First Dapp uses ethers.js and the second one web3.js :(

@wfoster232

This comment has been minimized.

Copy link

commented Mar 11, 2019

Also hitting this issue with 1.0.0-beta.48 when attempting to perform a web3.currentProvider.send({ method: 'personal_sign', params: params, from: _account});

@Philipid3s

This comment has been minimized.

Copy link

commented Mar 11, 2019

Same issue with 1.0.0-beta.48 - solved by installing the beta.37

@nicholaspai

This comment has been minimized.

Copy link

commented Mar 13, 2019

also resolved this by switching from beta.48 to beta.37

@arnigudj

This comment has been minimized.

Copy link

commented Mar 14, 2019

same here, resolved this by switching from beta.48 to beta.37... hoping that this will be resolved in beta.49

@kumavis

This comment has been minimized.

Copy link
Member

commented Mar 19, 2019

Opened an issue on web3.js with live reproduction demo ethereum/web3.js#2528

@kumavis

This comment has been minimized.

Copy link
Member

commented Mar 19, 2019

@wfoster232 this does not look correct, from should be encoded in the params

web3.currentProvider.send({ method: 'personal_sign', params: params, from: _account});
@kumavis

This comment has been minimized.

Copy link
Member

commented Mar 19, 2019

conclusion from #6262 (comment):

for web3@1.0.0-beta.38 the web3.eth.personal.sign requires a 3rd parameter, a password string (unused in metamask)

if you were using a callback before, it accidently includes the callback in the params in place of the password string. the callback is not json serializeable, thus throwing the error.

@kumavis

This comment has been minimized.

Copy link
Member

commented Mar 19, 2019

based on comments above, sounds like there are some additional issues (error on deploy, etc)

@jamesmorgan

This comment has been minimized.

Copy link

commented Apr 17, 2019

Ye I get this using Nuxtjs and metamask - any ideas? Will try to downgrade to 1.0.0-beta.37

@nickgeoca

This comment has been minimized.

Copy link

commented Apr 18, 2019

Have tried 1.0.0-beta.37 and other versions, even re-cloning and rebuilding the server, but keep getting the same errors.

  try { c = await MyContract.deployed(); } catch (e) {console.log(e);}

Firefox error

TypeError: "this.provider.sendAsync is undefined"
                   sendAsync contract.js:24
                   sendAsync requestmanager.js:80
                   get property.js:116
                   detectNetwork contract.js:512
                   Promise es6.promise.js:177
                   detectNetwork contract.js:503
                   deployed contract.js:451
                   _callee5$ TokenPollInterface.js:119

Chromium error

Uncaught (in promise) DOMException: Failed to execute 'postMessage' on 'Window': function (err, result) {
if(result && result.id && payload.id !== result.id) return callback(new Error(...<omitted>... } could not be cloned.
@ldub

This comment has been minimized.

Copy link

commented Apr 29, 2019

Also getting this error when using web3.eth.net.getId() or web3.eth.getBlockNumber() on 1.0.0-beta.48. Downgrading to 1.0.0-beta.37 does fix it but using an old version isnt a viable solution. It would be great to see an explanation of this issue.

In my setup, this error only occurs after I run a --mode production webpack build. when running with webpack-dev-server --mode development, this error doesnt happen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.