ajaxorg / ajaxorg/ace

Uncaught TypeError: Cannot read properties of null (reading 'splice')

Open
#5,277 6 comments 0 reactions 0 assignees View on GitHub
bug needs-reproduction-steps no-autoclose p2 response-requested
Dominant language
JavaScript
Stars
27.1k
Forks
5.3k
PR merge metrics
No merged PRs in 30d

Description

### Describe the bug

Using ace-build NPM package - Version 1.16.0

Use case 1 :

```
Uncaught TypeError: Cannot read properties of null (reading 'splice')
at d.updateFoldWidgets (ace.js:1:147561)
at r._signal (ace.js:1:12681)
at d.onChange (ace.js:1:157237)
at r._signal (ace.js:1:12681)
at a.applyDelta (ace.js:1:123862)
at a.insertMergedLines (ace.js:1:122174)
at a.insert (ace.js:1:121014)
at d.insert (ace.js:1:165721)
at S.insert (ace.js:1:232021)
at Object.exec (ace.js:1:205853)
```

and

```
ace.js:1 Uncaught TypeError: Cannot set properties of null (setting '0')
at d.updateFoldWidgets (ace.js:1:147438)
at r._signal (ace.js:1:12681)
at d.onChange (ace.js:1:157237)
at r._signal (ace.js:1:12681)
at a.applyDelta (ace.js:1:123862)
at a.insertMergedLines (ace.js:1:122174)
at a.insert (ace.js:1:121014)
at d.insert (ace.js:1:165721)
at S.insert (ace.js:1:232021)
at Object.exec (ace.js:1:205853)
```

Whenever I try to delete a whole document and enter a new character, it gets printed twice and the above error displayed in console.

Use case 2 :

```
Uncaught TypeError: Cannot read properties of null (reading 'splice')
at e.updateFoldWidgets (ace.js:1:159940)
at r._signal (ace.js:1:12681)
at e.onChange (ace.js:1:169827)
at r._signal (ace.js:1:12681)
at e.applyDelta (ace.js:1:135373)
at e.remove (ace.js:1:133834)
at e.remove (ace.js:1:178455)
at Object.exec (ace.js:1:215613)
at ace.js:1:203425
at r._emit.r._dispatchEvent (ace.js:1:12555)
```

Whenever I try to cut the code, the last two lines of the code gets copied to clipboard whereas other lines were gone and the above error displayed in console.

A help would be seriously appreciable as I struck in this for weeks and couldn't figure out what went wrong here.


### Expected Behavior

Use case 1 :
No double character printing should happen.

Use case 2 :
Cut operation should happen flawlessly.

### Current Behavior

Use case 1 :
Whenever I try to delete a whole document and enter a new character, it gets printed twice and the above error displayed in console.

Use case 2 :
Whenever I try to cut the code, the last two lines of the code gets copied to clipboard whereas other lines were gone and the above error displayed in console.

### Reproduction Steps

Use case 1 :
Whenever I try to delete a whole document and enter a new character, it gets printed twice and the above error displayed in console.

Use case 2 :
Whenever I try to cut the code, the last two lines of the code gets copied to clipboard whereas other lines were gone and the above error displayed in console.

### Possible Solution

_No response_

### Additional Information/Context

_No response_

### Ace Version / Browser / OS / Keyboard layout

ace : 1.16.0, macos 12.6.5, Chrome 115.0.5790.114

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.