Uncaught TypeError: Cannot read property 'querySelector' of undefined
Asked by Nikita Tikhomirov:

Page: https://confluence_url/admin/spaces/editglobalspacelayout.action

Plugins:

* Refined for Confluence
* Atlassian Troubleshooting and Support Tools
* Graphity - Diagram editor plugin for Confluence

Version: Atlassian Confluence 7.4.0

Code in which an error occurs:

```
init: function(e) {
e.on("init", (function() {
var e = {
contentId: M.get("content-id")
}
, t = c()("#rte-savebar-tinymce-plugin-point");
t.append('\n <span class="minor-edit toolbar-item">\n <input id="notifyWatchers" name="notifyWatchers" value="true" type="checkbox" checked>\n <label for="notifyWatchers">\n <span>'.concat(function(e) {
return ve(e)
}("editor.minor.edit"), "</span>\n </label>\n </span>\n"));
var n = t[0].querySelector('input[id="notifyWatchers"]')
, r = Ln.get("notifyWatchers", e.contentId, !0);
null !== r && (n.checked = r),
ne(n, "change", (function() {
Ln.set("notifyWatchers", e.contentId, !0, n.checked)
}
))
}
))
},
```

Error log from DevConsole:

```
batch.js?frontend.editor.v4=true&healthcheck-resources=true&hostenabled=true&locale=ru-RU:formatted:59157 Uncaught TypeError: Cannot read property 'querySelector' of undefined
at qC.<anonymous> (batch.js?frontend.editor.v4=true&healthcheck-resources=true&hostenabled=true&locale=ru-RU:formatted:59157)
at Pm.r.fire (batch.js?frontend.editor.v4=true&healthcheck-resources=true&hostenabled=true&locale=ru-RU:formatted:43917)
at qC.fire (batch.js?frontend.editor.v4=true&healthcheck-resources=true&hostenabled=true&locale=ru-RU:formatted:43953)
at cC (batch.js?frontend.editor.v4=true&healthcheck-resources=true&hostenabled=true&locale=ru-RU:formatted:50635)
at batch.js?frontend.editor.v4=true&healthcheck-resources=true&hostenabled=true&locale=ru-RU:formatted:50774
at batch.js?frontend.editor.v4=true&healthcheck-resources=true&hostenabled=true&locale=ru-RU:formatted:38742
at batch.js?frontend.editor.v4=true&healthcheck-resources=true&hostenabled=true&locale=ru-RU:formatted:37587
(anonymous) @ batch.js?frontend.editor.v4=true&healthcheck-resources=true&hostenabled=true&locale=ru-RU:formatted:23604
Pm.r.fire @ batch.js?frontend.editor.v4=true&healthcheck-resources=true&hostenabled=true&locale=ru-RU:formatted:23604
fire @ batch.js?frontend.editor.v4=true&healthcheck-resources=true&hostenabled=true&locale=ru-RU:formatted:23604
cC @ batch.js?frontend.editor.v4=true&healthcheck-resources=true&hostenabled=true&locale=ru-RU:formatted:23604
(anonymous) @ batch.js?frontend.editor.v4=true&healthcheck-resources=true&hostenabled=true&locale=ru-RU:formatted:23604
(anonymous) @ batch.js?frontend.editor.v4=true&healthcheck-resources=true&hostenabled=true&locale=ru-RU:formatted:23604
(anonymous) @ batch.js?frontend.editor.v4=true&healthcheck-resources=true&hostenabled=true&locale=ru-RU:formatted:23604
setTimeout (async)
(anonymous) @ batch.js?frontend.editor.v4=true&healthcheck-resources=true&hostenabled=true&locale=ru-RU:formatted:23604
(anonymous) @ batch.js?frontend.editor.v4=true&healthcheck-resources=true&hostenabled=true&locale=ru-RU:formatted:23604
t @ batch.js?frontend.editor.v4=true&healthcheck-resources=true&hostenabled=true&locale=ru-RU:formatted:23604
loadAll @ batch.js?frontend.editor.v4=true&healthcheck-resources=true&hostenabled=true&locale=ru-RU:formatted:23604
sC @ batch.js?frontend.editor.v4=true&healthcheck-resources=true&hostenabled=true&locale=ru-RU:formatted:23604
fC @ batch.js?frontend.editor.v4=true&healthcheck-resources=true&hostenabled=true&locale=ru-RU:formatted:23604
bC @ batch.js?frontend.editor.v4=true&healthcheck-resources=true&hostenabled=true&locale=ru-RU:formatted:23604
(anonymous) @ batch.js?frontend.editor.v4=true&healthcheck-resources=true&hostenabled=true&locale=ru-RU:formatted:23604
(anonymous) @ batch.js?frontend.editor.v4=true&healthcheck-resources=true&hostenabled=true&locale=ru-RU:formatted:23604
At @ batch.js?frontend.editor.v4=true&healthcheck-resources=true&hostenabled=true&locale=ru-RU:formatted:23604
s @ batch.js?frontend.editor.v4=true&healthcheck-resources=true&hostenabled=true&locale=ru-RU:formatted:23604
loadScripts @ batch.js?frontend.editor.v4=true&healthcheck-resources=true&hostenabled=true&locale=ru-RU:formatted:23604
loadQueue @ batch.js?frontend.editor.v4=true&healthcheck-resources=true&hostenabled=true&locale=ru-RU:formatted:23604
(anonymous) @ batch.js?frontend.editor.v4=true&healthcheck-resources=true&hostenabled=true&locale=ru-RU:formatted:23604
waitFor @ batch.js?frontend.editor.v4=true&healthcheck-resources=true&hostenabled=true&locale=ru-RU:formatted:23604
(anonymous) @ batch.js?frontend.editor.v4=true&healthcheck-resources=true&hostenabled=true&locale=ru-RU:formatted:23604
(anonymous) @ batch.js?frontend.editor.v4=true&healthcheck-resources=true&hostenabled=true&locale=ru-RU:formatted:23604
At @ batch.js?frontend.editor.v4=true&healthcheck-resources=true&hostenabled=true&locale=ru-RU:formatted:23604
s @ batch.js?frontend.editor.v4=true&healthcheck-resources=true&hostenabled=true&locale=ru-RU:formatted:23604
loadScripts @ batch.js?frontend.editor.v4=true&healthcheck-resources=true&hostenabled=true&locale=ru-RU:formatted:23604
loadQueue @ batch.js?frontend.editor.v4=true&healthcheck-resources=true&hostenabled=true&locale=ru-RU:formatted:23604
(anonymous) @ batch.js?frontend.editor.v4=true&healthcheck-resources=true&hostenabled=true&locale=ru-RU:formatted:23604
xC @ batch.js?frontend.editor.v4=true&healthcheck-resources=true&hostenabled=true&locale=ru-RU:formatted:23604
kC @ batch.js?frontend.editor.v4=true&healthcheck-resources=true&hostenabled=true&locale=ru-RU:formatted:23604
render @ batch.js?frontend.editor.v4=true&healthcheck-resources=true&hostenabled=true&locale=ru-RU:formatted:23604
u @ batch.js?frontend.editor.v4=true&healthcheck-resources=true&hostenabled=true&locale=ru-RU:formatted:23604
(anonymous) @ batch.js?frontend.editor.v4=true&healthcheck-resources=true&hostenabled=true&locale=ru-RU:formatted:23604
At @ batch.js?frontend.editor.v4=true&healthcheck-resources=true&hostenabled=true&locale=ru-RU:formatted:23604
c @ batch.js?frontend.editor.v4=true&healthcheck-resources=true&hostenabled=true&locale=ru-RU:formatted:23604
Re.i.bind @ batch.js?frontend.editor.v4=true&healthcheck-resources=true&hostenabled=true&locale=ru-RU:formatted:23604
H @ batch.js?frontend.editor.v4=true&healthcheck-resources=true&hostenabled=true&locale=ru-RU:formatted:23604
init @ batch.js?frontend.editor.v4=true&healthcheck-resources=true&hostenabled=true&locale=ru-RU:formatted:23604
initialise @ batch.js?frontend.editor.v4=true&healthcheck-resources=true&hostenabled=true&locale=ru-RU:formatted:23604
Ji @ batch.js?frontend.editor.v4=true&healthcheck-resources=true&hostenabled=true&locale=ru-RU:formatted:23604
(anonymous) @ batch.js?frontend.editor.v4=true&healthcheck-resources=true&hostenabled=true&locale=ru-RU:formatted:23604
(anonymous) @ batch.js?locale=ru-RU:2115
setTimeout (async)
(anonymous) @ batch.js?locale=ru-RU:2115
(anonymous) @ batch.js?locale=ru-RU:44
c @ batch.js?locale=ru-RU:44
fireWith @ batch.js?locale=ru-RU:44
ready @ batch.js?locale=ru-RU:44
H @ batch.js?locale=ru-RU:44
Show 13 more frames
```

![Annotation 2020-05-05 013121.png](/t5/image/serverpage/image-id/93413i4DD53D9C0E247874/image-size/large?v=v2&px=999 "Annotation 2020-05-05 013121.png")


Answers:
author: Nikita Tikhomirov
body: To fix issue with editing space layout, do this:

<https://docs.refined.com/display/rwot/Can%27t+edit+the+dashboard+or+space+layouts>

And delete temp-layout-page_3932222 (Where 3932222 can be different) page from rwlayoutkey space.

JS error remained.


Tags: bug