# Uncaught (in promise) TypeError: Cannot read property 'length' of undefined

**URL:** <https://techcommunity.softwareag.com/t/uncaught-in-promise-typeerror-cannot-read-property-length-of-undefined/207213>\
**Category:** Forum\
**Tags:** Mainframe-Integration, ApplinX\
**Created:** [February 10, 2020, 10:21am UTC](https://techcommunity.softwareag.com/t/uncaught-in-promise-typeerror-cannot-read-property-length-of-undefined/207213 "2020-02-10T10:21:37Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![BOUKAMO\_MOHAMMAD](https://avatars.discourse-cdn.com/v4/letter/b/d6d6ee/32.png) [@BOUKAMO\_MOHAMMAD](https://techcommunity.softwareag.com/u/BOUKAMO_MOHAMMAD)\
**Post date:** [February 10, 2020, 10:21am UTC](https://techcommunity.softwareag.com/t/uncaught-in-promise-typeerror-cannot-read-property-length-of-undefined/207213/1 "2020-02-10T10:21:37Z")

</div>

[b]Hello everyone,

I hope, you will help me with a mysterious issue wich occurs when i copy and paste text in input on my JSP.

the chrome devTools displays the error below :[/b]

```auto

 z_resourceReader.jsp?res=z_jsengine/z_engine.js:2460 Uncaught (in promise) TypeError: Cannot read property 'length' of undefined
    at GXTagMatrix.findNextInputFieldInRowLTR (z_resourceReader.jsp?res=z_jsengine/z_engine.js:2460)
    at GXTagMatrix.getNextInputElement0 (z_resourceReader.jsp?res=z_jsengine/z_engine.js:2418)
    at GXTagMatrix.getNextInputElement (z_resourceReader.jsp?res=z_jsengine/z_engine.js:2404)
    at Object.assignValueToInputElements (z_resourceReader.jsp?res=z_jsengine/z_emulator.js:888)
    at Object.gx_emulator.paste (eval at <anonymous> (eval at <anonymous> (z_resourceReader.jsp?res=z_jsengine/dojo.js:15)), <anonymous>:244:33)
    at Object.pasteText (eval at <anonymous> (eval at <anonymous> (z_resourceReader.jsp?res=z_jsengine/dojo.js:15)), <anonymous>:1548:18)
    at Object.paste (eval at <anonymous> (eval at <anonymous> (z_resourceReader.jsp?res=z_jsengine/dojo.js:15)), <anonymous>:1476:18)
    at eval (eval at <anonymous> (eval at <anonymous> (z_resourceReader.jsp?res=z_jsengine/dojo.js:15)), <anonymous>:1463:25)
    at eval (eval at <anonymous> (eval at <anonymous> (z_resourceReader.jsp?res=z_jsengine/dojo.js:15)), <anonymous>:1402:12)
```

But when i try this command in devTools everything work well : gx\_emulator.init()

Thank you for any solutions you can help me with.

 ![errors.PNG](https://global.discourse-cdn.com/techcommunity/original/2X/8/8d45067273384cabd060ba9028cef46638c26f0a.png)

---

<div class="post-metadata">

**Author:** ![Idan\_Zohar](https://avatars.discourse-cdn.com/v4/letter/i/c5a1d2/32.png) [@Idan\_Zohar](https://techcommunity.softwareag.com/u/Idan_Zohar)\
**Post date:** [February 12, 2020, 11:41am UTC](https://techcommunity.softwareag.com/t/uncaught-in-promise-typeerror-cannot-read-property-length-of-undefined/207213/2 "2020-02-12T11:41:39Z")

</div>

Hi Mohammad,

What versions of ApplinX are you using? Does this happen only in Chrome?

Regards,  
Idan

---

<div class="post-metadata">

**Author:** ![BOUKAMO\_MOHAMMAD](https://avatars.discourse-cdn.com/v4/letter/b/d6d6ee/32.png) [@BOUKAMO\_MOHAMMAD](https://techcommunity.softwareag.com/u/BOUKAMO_MOHAMMAD)\
**Post date:** [February 12, 2020, 12:02pm UTC](https://techcommunity.softwareag.com/t/uncaught-in-promise-typeerror-cannot-read-property-length-of-undefined/207213/3 "2020-02-12T12:02:24Z")

</div>

Hello Idan Zohar,

Thanks for your help, the previous issue was occured on the version 9.7.0.0001-0474, but now i changed the version, currently i work on 10.5 but i got others issues ;(

the 1st issue occurs when i login, i have the following issue :

```auto
VM868:64 Uncaught TypeError: gx_emulator.setCaretPosition is not a function
    at Object.gx_emulator.inputTagFocus0 (eval at <anonymous> (eval at <anonymous> (z_resourceReader.jsp?res=z_jsengine/dojo.js:15)), <anonymous>:64:19)
    at HTMLInputElement.inputTagFocus (z_resourceReader.jsp?res=z_jsengine/z_emulator.js:860)
    at GXEngine.setFocus (z_resourceReader.jsp?res=z_jsengine/z_engine.js:423)
    at focusByHost (z_resourceReader.jsp?res=z_jsengine/z_emulator.js:406)
gx_emulator.inputTagFocus0 @ VM868:64
inputTagFocus @ z_resourceReader.jsp?res=z_jsengine/z_emulator.js:860
GXEngine.setFocus @ z_resourceReader.jsp?res=z_jsengine/z_engine.js:423
focusByHost @ z_resourceReader.jsp?res=z_jsengine/z_emulator.js:406
setTimeout (async)
GXWindow.__handleFocus @ z_resourceReader.jsp?res=z_jsengine/z_window.js:312
GXWindow.init @ z_resourceReader.jsp?res=z_jsengine/z_window.js:91
GXEngine.__throwEvent @ z_resourceReader.jsp?res=z_jsengine/z_engine.js:574
GXEngine.continueInit @ z_resourceReader.jsp?res=z_jsengine/z_engine.js:279
GXEngine.init @ z_resourceReader.jsp?res=z_jsengine/z_engine.js:251
GXEngine.initFrame @ z_resourceReader.jsp?res=z_jsengine/z_engine.js:192
GXEngine.initTopFrame @ z_resourceReader.jsp?res=z_jsengine/z_engine.js:132
onload @ z_container.jsp:3
VM868:64 Uncaught TypeError: gx_emulator.setCaretPosition is not a function
    at Object.gx_emulator.inputTagFocus0 (eval at <anonymous> (eval at <anonymous> (z_resourceReader.jsp?res=z_jsengine/dojo.js:15)), <anonymous>:64:19)
    at focusByHost (z_resourceReader.jsp?res=z_jsengine/z_emulator.js:442)
gx_emulator.inputTagFocus0 @ VM868:64
focusByHost @ z_resourceReader.jsp?res=z_jsengine/z_emulator.js:442
setTimeout (async)
GXWindow.__handleFocus @ z_resourceReader.jsp?res=z_jsengine/z_window.js:312
GXWindow.init @ z_resourceReader.jsp?res=z_jsengine/z_window.js:91
GXEngine.__throwEvent @ z_resourceReader.jsp?res=z_jsengine/z_engine.js:574
GXEngine.continueInit @ z_resourceReader.jsp?res=z_jsengine/z_engine.js:279
GXEngine.init @ z_resourceReader.jsp?res=z_jsengine/z_engine.js:251
GXEngine.initFrame @ z_resourceReader.jsp?res=z_jsengine/z_engine.js:192
GXEngine.initTopFrame @ z_resourceReader.jsp?res=z_jsengine/z_engine.js:132
onload @ z_container.jsp:3
VM868:64 Uncaught TypeError: gx_emulator.setCaretPosition is not a function
    at Object.gx_emulator.inputTagFocus0 (eval at <anonymous> (eval at <anonymous> (z_resourceReader.jsp?res=z_jsengine/dojo.js:15)), <anonymous>:64:19)
    at focusByHost (z_resourceReader.jsp?res=z_jsengine/z_emulator.js:442)
gx_emulator.inputTagFocus0 @ VM868:64
focusByHost @ z_resourceReader.jsp?res=z_jsengine/z_emulator.js:442
setTimeout (async)
init @ z_resourceReader.jsp?res=z_jsengine/z_emulator.js:517
GXEngine.__throwEvent @ z_resourceReader.jsp?res=z_jsengine/z_engine.js:574
GXEngine.continueInit @ z_resourceReader.jsp?res=z_jsengine/z_engine.js:279
GXEngine.init @ z_resourceReader.jsp?res=z_jsengine/z_engine.js:251
GXEngine.initFrame @ z_resourceReader.jsp?res=z_jsengine/z_engine.js:192
GXEngine.initTopFrame @ z_resourceReader.jsp?res=z_jsengine/z_engine.js:132
onload @ z_container.jsp:3

```

and the others error occur when, i want to copy and paste some texts on my input i have thoses others errors … ;(

```auto

VM269:27 Uncaught TypeError: gx_emulator.extractEventElement is not a function
    at HTMLInputElement.gx_emulator.inputTagFocus (eval at <anonymous> (eval at <anonymous> (z_resourceReader.jsp?res=z_jsengine/dojo.js:15)), <anonymous>:27:32)
```

```auto
gx_emulator.inputTagFocus @ VM269:27
z_resourceReader.jsp?res=z_jsengine/z_emulator.js:1195 Uncaught (in promise) TypeError: Cannot read property 'evalSingleField' of undefined
    at Object.assignValueToInputElement (z_resourceReader.jsp?res=z_jsengine/z_emulator.js:1195)
    at Object.assignValueToInputElements (z_resourceReader.jsp?res=z_jsengine/z_emulator.js:1220)
    at Object.gx_emulator.paste (eval at <anonymous> (eval at <anonymous> (z_resourceReader.jsp?res=z_jsengine/dojo.js:15)), <anonymous>:244:33)
    at Object.pasteText (eval at <anonymous> (eval at <anonymous> (z_resourceReader.jsp?res=z_jsengine/dojo.js:15)), <anonymous>:1548:18)
    at Object.paste (eval at <anonymous> (eval at <anonymous> (z_resourceReader.jsp?res=z_jsengine/dojo.js:15)), <anonymous>:1476:18)
    at eval (eval at <anonymous> (eval at <anonymous> (z_resourceReader.jsp?res=z_jsengine/dojo.js:15)), <anonymous>:1463:25)
    at eval (eval at <anonymous> (eval at <anonymous> (z_resourceReader.jsp?res=z_jsengine/dojo.js:15)), <anonymous>:1402:12)
assignValueToInputElement @ z_resourceReader.jsp?res=z_jsengine/z_emulator.js:1195
assignValueToInputElements @ z_resourceReader.jsp?res=z_jsengine/z_emulator.js:1220
gx_emulator.paste @ VM269:244
pasteText @ VM275:1548
paste @ VM275:1476
eval @ VM275:1463
eval @ VM275:1402
Promise.then (async)
manageAsyncClipboardData @ VM275:1400
paste @ VM275:1462
onKeydown @ VM275:397
```

Thanks for your help.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [April 2, 2021, 3:44pm UTC](https://techcommunity.softwareag.com/t/uncaught-in-promise-typeerror-cannot-read-property-length-of-undefined/207213/4 "2021-04-02T15:44:13Z")

</div>


