# \[Version 1.0.0-beta.3\] Cannot read property 'replace' of undefined

**URL:** <https://discourse.nodered.org/t/version-1-0-0-beta-3-cannot-read-property-replace-of-undefined/15095>\
**Category:** General\
**Created:** [4 September 2019 11:19 UTC](https://discourse.nodered.org/t/version-1-0-0-beta-3-cannot-read-property-replace-of-undefined/15095 "2019-09-04T11:19:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Qin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/qin/32/12715_2.png) [@Qin](https://discourse.nodered.org/u/Qin)\
**Post date:** [4 September 2019 11:19 UTC](https://discourse.nodered.org/t/version-1-0-0-beta-3-cannot-read-property-replace-of-undefined/15095/1 "2019-09-04T11:19:32Z")

</div>

After updating version from 0.20.\* to 1.0.0-beta.3, following statement throw the error as title describe, but

```auto
var patt = /\B\$/g;
var Str = '$test';
Str.replace (patt, 'A.B.');

```

actually it's OK IN 0.20.\*

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [4 September 2019 11:32 UTC](https://discourse.nodered.org/t/version-1-0-0-beta-3-cannot-read-property-replace-of-undefined/15095/2 "2019-09-04T11:32:53Z")

</div>

Hi @Qin,

where exactly have you got those statements? In a Function node?

Is there anything else or is that the full function?

Just pasting those three lines into a function node and triggering it doesn't cause any error message for me.

---

<div class="post-metadata">

**Author:** ![Qin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/qin/32/12715_2.png) [@Qin](https://discourse.nodered.org/u/Qin)\
**Post date:** [5 September 2019 01:16 UTC](https://discourse.nodered.org/t/version-1-0-0-beta-3-cannot-read-property-replace-of-undefined/15095/3 "2019-09-05T01:16:42Z")

</div>

Dear Nick,

Sorry for late reply.  
These statement is running in my custom function node.  
But it's very very strange, it's okay today. ( I don't know why...)

Uh...I committed an awful gaffe.

Sorry for bother your work.
