5.4 Cannot read property 'enumerable' of undefined
See original GitHub issueHey all, ViewModel is 5.4 is lighting up my console with waaaay too much red text!
My class objects which I’m using as ViewModels have the usual observable properties, but occasional functions as well.
It seems like this is the culprit https://github.com/mobxjs/mobx-utils/blob/5d147c1a43376cb6da71d21197ed5ad21ccf77d5/src/create-view-model.ts#L59
In this loop, https://github.com/mobxjs/mobx-utils/blob/5d147c1a43376cb6da71d21197ed5ad21ccf77d5/src/create-view-model.ts#L46
As soon as the key
is the name of a function in my class object, I get Uncaught TypeError: Cannot read property 'enumerable' of undefined
and everything explodes. 5.2 works great.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:7 (5 by maintainers)
Top Results From Across the Web
How to fix 'Type Error: Cannot Read Property 'name' of ...
How to fix 'Type Error: Cannot Read Property 'name' of undefined when trying to access properties of an object' in React.
Read more >mobx-utils/CHANGELOG.md
1, # 5.4.1. 2. 3, * Fixed `cannot read property enumerable of undefined` error, ... `case` will now return the resolved value, rather...
Read more >Enumerability and ownership of properties - JavaScript | MDN
Every property in JavaScript objects can be classified by three factors: Enumerable or non-enumerable;; String or symbol;; Own property or ...
Read more >Node.js v19.3.0 Documentation
Error names and messages are always compared, even if these are not enumerable properties. Object wrappers are compared both as objects and unwrapped...
Read more >ECMAScript® 2023 Language Specification
6.1.1 The Undefined Type; 6.1.2 The Null Type; 6.1.3 The Boolean Type; ◢6.1.4 The String Type ... ◢6.2.6 The Property Descriptor Specification Type....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Please review this fix https://github.com/mobxjs/mobx-utils/pull/198 Sorry for the miss…
This seems fixed now in 5.4.1. Thanks!