Comments (6)
I'm having this issue as well. This happens when you post more complicated objects to dispatcher. For example an request configuration:
StatusActions.failed({config: err.config, action: context.actionDetails});
It goes through dispatcher without problems, but the extension needs to use postMessage, and some objects are too much for it's serialization engine. When I put the data through JSON.stringify, it does not cause this error. Solution might be to use JSON.stringify when postMessaging an object of type Object to the extension. @goatslacker what do you think?
from alt-devtool.
I just had this occur for bound functions. I think stringifying before postMessage would be the safest bet. (I'm passing functions to deal with some weird stuff, it'll hopefully go away soon.)
from alt-devtool.
https://github.com/goatslacker/alt-devtool/blob/master/scripts/utils/post.js#L4 It's here.
Some things might need to change since I already stringify some payloads, I think? We don't want to double stringify
from alt-devtool.
I was having this issue as well and the errors it was throwing caused parts of my app to break so I tracked it down. The issue is with post
but only when it's being called for dispatches at this spot.
The exception is caused by the browser's implementation of the structured cloning algorithm, which Window.postMessage
uses to clone objects. The implementation of the cloning algorithm causes an error to be thrown when attempting to clone error, function, and DOM node objects.
In my case, I was passing a fetch response object from axios through the payload which contains function and error objects, thus causing the clone method inside Window.postMessage
to throw the error.
Some things might need to change since I already stringify some payloads, I think? We don't want to double stringify
You're only calling stringify in one other place, which is for data related to Stores. This is why the error only shows up for dispatches, since the store's data is already safely stringifyed. I made a fix (see PR #11) that calls JSON.stringify
on the dispatchers' payloads as well. After that everything runs perfectly for me.
from alt-devtool.
Nice debugging!
from alt-devtool.
I think this is good to close now. I've updated the crx.
from alt-devtool.
Related Issues (20)
- Exception when loading an Alt app HOT 4
- chrome disables Alt-devtools . HOT 2
- Provide Chrome store URL in the README HOT 3
- Uncaught TypeError: CSV.parseCSV is not a symbol HOT 3
- Log dispatches boolean is reversed
- Debugger causes alt to crap out when JSON.stringify fails HOT 5
- Connect to Alt in iframe? HOT 3
- Not from Chrome Web Store HOT 8
- Failure with createStore() HOT 5
- Better defined releases HOT 5
- Create a release script
- Update available size and re-render when tool window was resized HOT 2
- Not working with webpack HOT 2
- Can't see the store object in debugger tool HOT 2
- Dispatches are string
- please update the alt devtool
- Logs Store in devtools only when i console.log(Store)
- Use takeSnapshot in parseStores rather than using getState()
- Double selecting on some dispatches that include no data.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from alt-devtool.