"cannot read properties of undefined" after upgrading @codemirror/autocomplete to 6.20.2 #1703

Open
opened 2026-05-11 16:03:49 +02:00 by olivvybee · 1 comment

I'm using codemirror 6.0.2 with the @codemirror/lang-jinja extension at 6.0.1. I've manually installed @codemirror/autocomplete as a dev dependency to access the typescript types to use in my application.

Everything is working fine with @codemirror/autocomplete at version 6.20.1, but as soon as I upgrade to 6.20.2 I start seeing the error Cannot read properties of undefined (reading 'length').

Here's the stack trace:

TypeError: Cannot read properties of undefined (reading 'length')
    at TreeNode.nextChild (index.js:747:85)
    at TreeCursor.enterChild (index.js:1046:42)
    at TreeCursor.firstChild (index.js:1058:32)
    at MixedParse.startInner (index.js:1938:33)
    at MixedParse.advance (index.js:1831:18)
    at MixedParse.advance (index.js:1842:68)
    at index.js:363:39
    at ParseContext.withContext (index.js:398:20)
    at ParseContext.work (index.js:351:21)
    at init (index.js:544:25)
    at StateField.create (index.js:1758:90)
    at Object.create (index.js:1767:42)
    at EditorState.computeSlot (index.js:2748:129)
    at ensureAddr (index.js:2013:25)
    at new EditorState (index.js:2549:13)
    at EditorState.create (index.js:2748:16)

I'm using the jinja extension with variables and properties configuration set.

If I remove the jinja extension from my editor then the error goes away. Just removing the variables or properties from the extension initialiser does not prevent the error.

If I downgrade @codemirror/autocomplete to 6.20.1 then the error also goes away.

I'm using codemirror 6.0.2 with the `@codemirror/lang-jinja` extension at 6.0.1. I've manually installed `@codemirror/autocomplete` as a dev dependency to access the typescript types to use in my application. Everything is working fine with `@codemirror/autocomplete` at version 6.20.1, but as soon as I upgrade to 6.20.2 I start seeing the error `Cannot read properties of undefined (reading 'length')`. Here's the stack trace: ``` TypeError: Cannot read properties of undefined (reading 'length') at TreeNode.nextChild (index.js:747:85) at TreeCursor.enterChild (index.js:1046:42) at TreeCursor.firstChild (index.js:1058:32) at MixedParse.startInner (index.js:1938:33) at MixedParse.advance (index.js:1831:18) at MixedParse.advance (index.js:1842:68) at index.js:363:39 at ParseContext.withContext (index.js:398:20) at ParseContext.work (index.js:351:21) at init (index.js:544:25) at StateField.create (index.js:1758:90) at Object.create (index.js:1767:42) at EditorState.computeSlot (index.js:2748:129) at ensureAddr (index.js:2013:25) at new EditorState (index.js:2549:13) at EditorState.create (index.js:2748:16) ``` I'm using the `jinja` extension with `variables` and `properties` configuration set. If I remove the `jinja` extension from my editor then the error goes away. Just removing the `variables` or `properties` from the extension initialiser does not prevent the error. If I downgrade `@codemirror/autocomplete` to 6.20.1 then the error also goes away.
Owner

Can you check (with npm ls -a) whether any @codemirror or @lezer packages are installed multiple times in your tree after the upgrade? (Disregard the ones that day 'deduplicated'.)

Can you check (with `npm ls -a`) whether any @codemirror or @lezer packages are installed multiple times in your tree after the upgrade? (Disregard the ones that day 'deduplicated'.)
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
codemirror/dev#1703
No description provided.