question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

5.4 Cannot read property 'enumerable' of undefined

See original GitHub issue

Hey 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:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
dr0pcommented, May 7, 2019

Please review this fix https://github.com/mobxjs/mobx-utils/pull/198 Sorry for the miss…

0reactions
timothyallancommented, Jun 7, 2019

This seems fixed now in 5.4.1. Thanks!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found