Cursor errors out and stops generating every new chat

Describe the Bug

I have quite a sophisticated custom mode instructions that requires to load multiple files on startup for context. I see that when reading these files, the Cursor commonly breaks and stops generating. See here: Loom | Free Screen & Video Recording Software | Loom

The error mentions “TypeError: Cannot read properties of undefined (reading ‘re=>re.codeBlockIdx===h’)”. I tried debugging it bug failed without comprehensive source maps.

Steps to Reproduce

I do not think it’s reproducible consistently outside of my setup.

Operating System

MacOS

Current Cursor Version (Menu → About Cursor → Copy)

Version: 1.2.2 (Universal)
VSCode Version: 1.99.3
Commit: faa03b17cce93e8a80b7d62d57f5eda6bb6ab9f0
Date: 2025-07-07T06:07:27.002Z
Electron: 34.5.1
Chromium: 132.0.6834.210
Node.js: 20.19.0
V8: 13.2.152.41-electron.0
OS: Darwin arm64 24.5.0

Does this stop you from using Cursor

No - Cursor works, but with this issue

1 Like

Investigating this, I found that is comes from updatedComposerDataStore method. In there, the setData is called, with the following path:

Once it get’s in the conversationMap[“18df8bdc-b3a3-4dee-b1a7-c71c101df44f”][“codeBlocks”] propery is undefined, causing AI to break. So I guess using code blocks in generation is not safe.

I see that the “content” property later full value is (I escaped it manually):

"EXECUTING: Version compatibility check...
Expected: CODER Workflow v3.0
Checking: .cursor/workflows/coder_workflow.md
```✅"

I will try to instruct AI to avoid using code blocks to fix this, to see if it solves the issue, for finding the issue in code, lookup the ^(?:\\r?\\n)([\\t ]{${u}})\{${a}}\S+regex, the next call tothis._composerDataService.updateComposerDataSetStore` is what causes the issue.

1 Like

Once I removed the requirement to log the current step in the codeblock (and used quotes), the AI no longer stops mid generation. I still think that’s a problem with code.

1 Like

This topic was automatically closed 22 days after the last reply. New replies are no longer allowed.