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.

Cannot read properties of undefined (reading 'map')

See original GitHub issue

As follow, i am working on changing mode when editing.

There seems this.instance.setOption("mode",mode) has no error, but then, the editor can’t be focused on and Cannot read properties of undefined (reading 'map') appears.

What should i do? please help me.

image image image

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
marijnhcommented, Feb 28, 2022

I don’t know a lot about Vue, but I do know that is does strange things to objects managed as part of its state, and you don’t want to put complicated stateful objects like a CodeMirror instance in there. Try refactoring your code to not have the CodeMirror instance in the data object.

0reactions
lperez22commented, May 25, 2022

Thank you so much I was having the same issue Cannot read properties of undefined (reading ‘map’) occasionally and I removed codemirror instance from data object and instance just assigned it to a const.

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeError: Cannot read properties of undefined (reading 'map')
The properties, products , that you're passing to your component ( Products ) are undefined. The Map method is taking in account the ......
Read more >
Fix 'cannot read properties of undefined (reading map)' in JS
The "Uncaught TypeError: Cannot read properties of undefined (reading 'map')" error occurs in JavaScript, whenever you try to use the array ...
Read more >
Cannot read properties of undefined (reading 'map') in React
The "TypeError: Cannot read properties of undefined (reading 'map')" occurs when we call the map() method on an undefined value, most often when...
Read more >
How to Prevent the TypeError: Cannot Read Property Map of ...
As a result, the TypeError Cannot read property 'map' of undefined is very common and one of the first errors that developers will...
Read more >
Can Not Read Properties of Undefined Reading Map in React ...
If you are looking at can not read properties of undefined reading map in react js error or map function is not displaying...
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