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

Changes tab, ObservableMap open error. #43

Open
YuK1Game opened this issue Dec 18, 2018 · 2 comments
Open

Changes tab, ObservableMap open error. #43

YuK1Game opened this issue Dec 18, 2018 · 2 comments

Comments

@YuK1Game
Copy link

I use Changes tab and click to ObservableMap@5{...} +1 -1,
not working.

chrome console error
backend.js:4189 Uncaught DOMException: Failed to execute 'postMessage' on 'Window': [object Object] could not be cloned.

@pfurini
Copy link

pfurini commented Mar 6, 2019

chrome console error
backend.js:4189 Uncaught DOMException: Failed to execute 'postMessage' on 'Window': [object Object] could not be cloned.

This is a known issue of using postMessage, see: https://stackoverflow.com/questions/52122011/failed-to-execute-postmessage-on-window-googletagmanager/52223341#52223341

The code of the extension should be changed to tackle this. If you want to try yourself a workaround, when this error appears in the console (Chrome):

backend.js:4189 Uncaught DOMException: Failed to execute 'postMessage' on 'Window': [object Object] could not be cloned.
    at Object.send (chrome-extension://pfgnfdagidkfgccljigdamigbcnndkod/backend.js:4189:14)
    at Bridge.flushBufferSlice (chrome-extension://pfgnfdagidkfgccljigdamigbcnndkod/backend.js:1045:18)
    at Bridge.flushBufferWhileIdle (chrome-extension://pfgnfdagidkfgccljigdamigbcnndkod/backend.js:1023:14)

click on the first line of the trace (backend.js) and you will be pointed to the source of the error.

Then you'll see the following lines:

    send: function send(data) {
      (0, _debugConnection2.default)('[BACKEND -> contentScript]', data);
      window.postMessage({ source: 'mobx-devtools-backend', payload: data, contentScriptId: contentScriptId, backendId: backendId }, '*');
    }

change them with the following:

    send: function send(data) {
      (0, _debugConnection2.default)('[BACKEND -> contentScript]', data);
      window.postMessage({ source: 'mobx-devtools-backend', payload: JSON.parse(JSON.stringify(data)), contentScriptId: contentScriptId, backendId: backendId }, '*');
    }

then save the file.
The error will disappear until you refresh your browser.

I don't know if this project is maintained anymore, maybe I'll open a PR with a fix in the future..

@andykog
Copy link
Member

andykog commented Mar 9, 2019

Works for me, how to reproduce it?
Screen Shot 2019-03-09 at 16 28 48

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

No branches or pull requests

3 participants