# Visual Studio Code extension 1.0.2: "Notification handler 'textDocument/didChange' failed — Cannot read properties of undefined (reading 'update')" on all openHAB files

**URL:** <https://community.openhab.org/t/visual-studio-code-extension-1-0-2-notification-handler-textdocument-didchange-failed-cannot-read-properties-of-undefined-reading-update-on-all-openhab-files/170629>\
**Category:** Add-ons\
**Created:** [October 8, 2026, 7:38am UTC](https://community.openhab.org/t/visual-studio-code-extension-1-0-2-notification-handler-textdocument-didchange-failed-cannot-read-properties-of-undefined-reading-update-on-all-openhab-files/170629 "2026-10-08T07:38:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![HenMus](https://community.openhab.org/user_avatar/community.openhab.org/henmus/32/114646_2.png) [@HenMus](https://community.openhab.org/u/HenMus)\
**Post date:** [October 8, 2026, 7:38am UTC](https://community.openhab.org/t/visual-studio-code-extension-1-0-2-notification-handler-textdocument-didchange-failed-cannot-read-properties-of-undefined-reading-update-on-all-openhab-files/170629/1 "2026-10-08T07:38:35Z")

</div>

First of all, thanks for 1.0.2 — hover on items inside `.js` files is exactly what I was missing, and it works nicely.

There is one side effect. Since installing 1.0.2 I get an error in the **language server** output channel every time I touch an openHAB configuration file. Adding a single space is enough to trigger it, and it repeats on every keystroke.

```php
[Error - 9:27:41 AM] Notification handler 'textDocument/didOpen' failed with message: Cannot read properties of undefined (reading 'create')
[Error - 9:27:41 AM] Notification handler 'textDocument/didChange' failed with message: Cannot read properties of undefined (reading 'update')

```

**Clearly tied to the version**

- 1.0.2 installed: the errors appear.
- Back to 1.0.0: the errors are gone.

**When it happens**

- On every openHAB file: `.items`, `.things`, `.rules`, `.sitemap`, `.persist`. `didOpen` fires once when the file is opened, `didChange` on every edit.
- **Not** on `.js` files, which is the odd part given that JS support is what 1.0.2 adds.
- Hover, validation and completion still appear to work, so this is noise rather than a broken feature — but the server’s document mirror is clearly not being updated, and I don’t know what silently depends on that.

**Setup**

- openHAB 5.2.0 in Docker on Ubuntu, config on a shared folder
- VS Code 1.140.0, openHAB extension 1.0.2
- Remote language server enabled:

```php
"openhab.useRestApi": true,
"openhab.connection.host": "192.168.100.52",
"openhab.connection.port": 8080,
"openhab.languageserver.remoteEnabled": true,
"openhab.languageserver.remotePort": 5007

```

**Likely cause**

The message is a JavaScript `TypeError`, so it comes from the JS side rather than from the Xtext server. Both messages match the signature of a `TextDocuments` instance created without the document factory. Since `vscode-languageserver` 6, the constructor requires it; without it the internal configuration is `undefined`, and `didOpen` fails on `.create()` while `didChange` fails on `.update()` — exactly the pair above.

```php
// fails on didOpen/didChange with vscode-languageserver >= 6
const documents = new TextDocuments();

// expected
const { TextDocument } = require('vscode-languageserver-textdocument');
const documents = new TextDocuments(TextDocument);

```

Would you be able to look at this? I’d rather stay on 1.0.2 for the JS hover, so I’m happy to supply a verbose trace or test a patched build.

---

<div class="post-metadata">

**Author:** ![sihui](https://community.openhab.org/user_avatar/community.openhab.org/sihui/32/55674_2.png) [@sihui](https://community.openhab.org/u/sihui)\
**Post date:** [October 8, 2026, 9:02am UTC](https://community.openhab.org/t/visual-studio-code-extension-1-0-2-notification-handler-textdocument-didchange-failed-cannot-read-properties-of-undefined-reading-update-on-all-openhab-files/170629/2 "2026-10-08T09:02:18Z")

</div>

> [@HenMus](#):
>
> I’d rather stay on 1.0.2

You should mention in the header you are talking about the Visual Studio Code extension to get better attraction. 😇
