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.

Uncaught TypeError: Cannot read property 'replace' of undefined

See original GitHub issue

Fails in both cases, when string is null or when it is undefined.

image

Should be return str && str.replace....

Occurs in multiple places: https://github.com/lovasoa/react-contenteditable/commit/aa9a48732bef3352e9a958eea954a4d93b8315d7

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:8
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
lovasoacommented, Aug 2, 2018

Thank you very much to @aleemb for reporting and fixing this bug, and sorry for the lack of reactivity.

I published a new version on npm, so the bug is fixed as of version 2.1.1.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[SOLVED] Cannot Read Property 'replace' of Undefined in JS
To fix the “cannot read property 'replace' of undefined” error, perform an undefined check on the variable before calling the replace() method ......
Read more >
Cannot read property 'replace' of Undefined in JS - Isotropic
In the above example, the first string was not initialized so the error showed up. The second string worked fine at first because...
Read more >
cannot read property 'replace' of undefined In Grid - Stack ...
I think jQuery cannot find the element. First of all find the element var rowTemplate= document.getElementsByName("rowTemplate");.
Read more >
TypeError: Cannot read property 'replace' of undefined
So I tried to learn how to do this on my own by taking two video courses about node and cheerio on udemy...
Read more >
editor.min.js Uncaught TypeError: Cannot read property ...
editor.min.js Uncaught TypeError: Cannot read property 'replace' of undefined ... It might be an issue with theme itself, so created almost empty theme...
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