reactotron: An object with `writable: false` prop in a state breaks SagaMonitor
We’ve recently added reactotron to our project and it’s pretty cool. We’ve noticed though that it raises an unhandled exception on read-only object’ props in sagas and actions attributes.
object[key] = getFunctionName(value);
an error is raised Cannot assign to read only property 'replace' of object. key === 'replace'.
I’ve noticed that it happens only when an object’s key is read-only.
Object.getOwnPropertyDescriptor(object, key)
// result:
{
configurable: false,
enumerable: true,
value: '',
writable: false
}
Why do we have a read-only value in an object is a good question and we definitely need to change that, but as a quicker solution we would love to have reactotron not break our app [:
I can add a fork where we run
object[key] = getFunctionName(value);
only when
Object.getOwnPropertyDescriptor(object, key).writable
is true. Will that solve the issue?
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 22 (12 by maintainers)
Commits related to this issue
- chore(deps): update dependency eslint to v7.7.0 (#351) Co-authored-by: Renovate Bot <bot@renovateapp.com> — committed to infinitered/reactotron by renovate[bot] 4 years ago
- chore(deps): update dependency rollup to v2.3.2 (#351) Co-authored-by: Renovate Bot <bot@renovateapp.com> — committed to infinitered/reactotron by renovate[bot] 4 years ago
- chore(deps): update jest monorepo to v25.5.1 (#351) Co-authored-by: Renovate Bot <bot@renovateapp.com> — committed to infinitered/reactotron by renovate[bot] 4 years ago
- chore(deps): update dependency jest to v25.5.2 (#351) Co-authored-by: Renovate Bot <bot@renovateapp.com> — committed to infinitered/reactotron by renovate[bot] 4 years ago
- chore(deps): update dependency rollup to v2.10.1 (#351) Co-authored-by: Renovate Bot <bot@renovateapp.com> — committed to infinitered/reactotron by renovate[bot] 4 years ago
Ugh… with a comment like that, I can’t even claim it was an accident either.
@skellock it’s working perfectly now! thanks!
Thx for letting me know.
Reactotron is back at the top of my list of priorities now that I’ve finished gluegun and wrapping up ignite 2.
Keep ya posted.
@skellock I wasn’t gonna say anything about that comment ;D