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)
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):
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.
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.