# \[Major Bug\] Undo Action Breaks

**URL:** https://forum.pinegrow.com/t/major-bug-undo-action-breaks/3814
**Category:** Bug Reports
**Created:** [February 27, 2020, 7:04pm UTC](https://forum.pinegrow.com/t/major-bug-undo-action-breaks/3814 "2020-02-27T19:04:00Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![KodMi](https://avatars.discourse-cdn.com/v4/letter/k/82dd89/32.png) [@KodMi](https://forum.pinegrow.com/u/KodMi)
#### Post date: [February 27, 2020, 7:04pm UTC](https://forum.pinegrow.com/t/major-bug-undo-action-breaks/3814/1 "2020-02-27T19:04:00Z")

</div>

The undo action breaks when you add any piece of code to the

```auto
<head></head>
```

Problem will trigger every single time, and when it triggers you cannot “Undo” pass that point anymore.

Even if its a valid tag like.

```auto
<meta name="description" content="">
```

Why this is a Major Bug, it can also disable the “undo” action for the remainder of the session under the right conditions. I’m not exactly sure the conditions but has happened to me many times an “undo” feature completely stops working at all. It can corrupt the users project/file if they make another mistake, who need to undo it but no longer can.

The only solution to the problem once it completely stops working is to restart the app, which can result in work loss or a corrupted project, where errors can’t be undone.

The only workaround so this problem doesn’t happen is when modifying code, use the Live Sync setup and use an external IDE.

---

<div class="post-metadata">

### Author: ![matjaz](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/matjaz/32/5_2.png) [@matjaz](https://forum.pinegrow.com/u/matjaz)
#### Post date: [February 27, 2020, 10:10pm UTC](https://forum.pinegrow.com/t/major-bug-undo-action-breaks/3814/2 "2020-02-27T22:10:36Z")

</div>

@KodMi, how do you edit the code in head when this happens? In internal code editor? With element code?

---

<div class="post-metadata">

### Author: ![KodMi](https://avatars.discourse-cdn.com/v4/letter/k/82dd89/32.png) [@KodMi](https://forum.pinegrow.com/u/KodMi)
#### Post date: [February 28, 2020, 1:52am UTC](https://forum.pinegrow.com/t/major-bug-undo-action-breaks/3814/3 "2020-02-28T01:52:11Z")

</div>

Directly from the “Page-\>Edit Code”. Ctrl+E command to bring up the editor. Would be the internal editor I believe.

Element editor, something similar happens as well. The Undo will crash the element editing as-well I’ve noticed and close it out. Then you can’t right click Html that you was just editing in Element editor from the internal code editor

Not sure if it matters but I’m running a i9-9900k with 64gb ram and a Samsung 970 Evo Plus SSD for HDD and a MSI GTX 1080 for a graphics card on windows 10 64/32bit

---

<div class="post-metadata">

### Author: ![matjaz](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/matjaz/32/5_2.png) [@matjaz](https://forum.pinegrow.com/u/matjaz)
#### Post date: [February 28, 2020, 3:25am UTC](https://forum.pinegrow.com/t/major-bug-undo-action-breaks/3814/4 "2020-02-28T03:25:30Z")

</div>

@KodMi do you see any red errors in the Console? (right-click on the Pinegrow logo top left and select Inspect).

---

<div class="post-metadata">

### Author: ![KodMi](https://avatars.discourse-cdn.com/v4/letter/k/82dd89/32.png) [@KodMi](https://forum.pinegrow.com/u/KodMi)
#### Post date: [February 28, 2020, 3:59am UTC](https://forum.pinegrow.com/t/major-bug-undo-action-breaks/3814/5 "2020-02-28T03:59:02Z")

</div>

When I get the issue on Element Editor:

```auto
Undo error TypeError: Cannot read property 'html' of null
Undo error TypeError: Cannot read property 'setAttr' of null
crsa.undo.js:1005 
```

When I get the issue on internal editor:

```auto
Undo error Create node from html failed. Only one node can be created. crsa.undo.js:1005 
```

How ever both are not a “red x” error.

---

<div class="post-metadata">

### Author: ![matjaz](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/matjaz/32/5_2.png) [@matjaz](https://forum.pinegrow.com/u/matjaz)
#### Post date: [February 28, 2020, 4:00am UTC](https://forum.pinegrow.com/t/major-bug-undo-action-breaks/3814/6 "2020-02-28T04:00:55Z")

</div>

Thanks @KodMi. Can you please send me your project to support [at] pinegrow [dot] com?

---

<div class="post-metadata">

### Author: ![KodMi](https://avatars.discourse-cdn.com/v4/letter/k/82dd89/32.png) [@KodMi](https://forum.pinegrow.com/u/KodMi)
#### Post date: [February 28, 2020, 4:08am UTC](https://forum.pinegrow.com/t/major-bug-undo-action-breaks/3814/7 "2020-02-28T04:08:18Z")

</div>

It’s the stock ST2 Theme from github I’m playing with, but even if I create a new project with “bootstrap 4-\>index.html” I still get all the issues.

I’ve taken the liberty to upload a video to show the bug in action.  
[Bug Video](https://streamable.com/tptrf)

---

<div class="post-metadata">

### Author: ![KodMi](https://avatars.discourse-cdn.com/v4/letter/k/82dd89/32.png) [@KodMi](https://forum.pinegrow.com/u/KodMi)
#### Post date: [February 28, 2020, 5:13am UTC](https://forum.pinegrow.com/t/major-bug-undo-action-breaks/3814/8 "2020-02-28T05:13:31Z")

</div>

> [@matjaz](#):
>
> (right-click on the Pinegrow logo top left and select Inspect).

You can hit the key “f12” to achieve the same thing

---

<div class="post-metadata">

### Author: ![matjaz](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/matjaz/32/5_2.png) [@matjaz](https://forum.pinegrow.com/u/matjaz)
#### Post date: [February 28, 2020, 9:17am UTC](https://forum.pinegrow.com/t/major-bug-undo-action-breaks/3814/9 "2020-02-28T09:17:32Z")

</div>

Thanks, I think I fixed the issue. The update will be out soon.

---

<div class="post-metadata">

### Author: ![KodMi](https://avatars.discourse-cdn.com/v4/letter/k/82dd89/32.png) [@KodMi](https://forum.pinegrow.com/u/KodMi)
#### Post date: [March 4, 2020, 1:09am UTC](https://forum.pinegrow.com/t/major-bug-undo-action-breaks/3814/10 "2020-03-04T01:09:23Z")

</div>

The update today sorta fixes but doesn’t fix the problem and makes it worse.

The video will explain:  
Error: [https://streamable.com/yhlqq](https://streamable.com/yhlqq).

```auto
pg-parser.js:4822 Uncaught TypeError: Cannot read property 'getViewHTMLForElement' of null
    at getElement (pg-parser.js:4822)
    at PgNodeEventDOMPlayer.play (pg-parser.js:4842)
    at PgEventHandler.PgPageViewPlayer.event_handler.on_event (pg.page-view-player.js:26)
    at Array.received (pg-parser.js:4768)
    at PgEventConductor.emit (pg-parser.js:4730)
    at pgParserNode.emitEvent (pg-parser.js:4690)
    at pgParserNode.withEmitEvent (pg-parser.js:4706)
    at pgParserNode.removeChild (pg-parser.js:1071)
    at pgParserNode.removeWithoutEvents (pg-parser.js:1820)
    at pgParserNode.removeWithoutEvents (pg-parser.js:1826)
getElement @ pg-parser.js:4822
PgNodeEventDOMPlayer.play @ pg-parser.js:4842
PgPageViewPlayer.event_handler.on_event @ pg.page-view-player.js:26
received @ pg-parser.js:4768
PgEventConductor.emit @ pg-parser.js:4730
pgParserNode.emitEvent @ pg-parser.js:4690
pgParserNode.withEmitEvent @ pg-parser.js:4706
pgParserNode.removeChild @ pg-parser.js:1071
pgParserNode.removeWithoutEvents @ pg-parser.js:1820
pgParserNode.removeWithoutEvents @ pg-parser.js:1826
CrsaPage.applyChangesToSource @ crsa.pages.js:3280
PgApiCodeEditorConnector.codeChangedInEditor @ crsa.edit.js:24
editor.onChange @ crsa.edit.js:240
doChange @ pg.page.code.js:185
(anonymous) @ pg.page.code.js:209
setTimeout (async)
(anonymous) @ pg.page.code.js:208
(anonymous) @ codemirror.js:2173
fireCallbacksForOps @ codemirror.js:2130
finishOperation @ codemirror.js:2144
endOperation @ codemirror.js:3650
runInOp @ codemirror.js:3779
TextareaInput.poll @ codemirror.js:9123
(anonymous) @ codemirror.js:8923
pg.page.code.js:208 node exception TypeError: Cannot read property 'getViewHTMLForElement' of null
```

---

<div class="post-metadata">

### Author: ![matjaz](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/matjaz/32/5_2.png) [@matjaz](https://forum.pinegrow.com/u/matjaz)
#### Post date: [March 4, 2020, 9:16am UTC](https://forum.pinegrow.com/t/major-bug-undo-action-breaks/3814/11 "2020-03-04T09:16:54Z")

</div>

Thanks @KodMi, I sent you a direct message about checking a potential solution.
