Thanks Sanjeed,
I love Cursor 2.0, but this “bug” is causing me pain because I make a .md for every page of my website. Below is an analysis (written in cursor, of course!)
Thank you for the follow-up. Here are the details and our findings.## Console errorsFrom Developer Tools > Console:
ERR Unable to retrieve document from URI ‘file:///d%3A/inetpub/wwwroot/askARTreact/docs/admin/reports/ad-reporting.md’: Error: Unable to retrieve document from URI ‘file:///d%3A/inetpub/wwwroot/askARTreact/docs/admin/reports/ad-reporting.md’
Lyu: Assertion Failed: Argument is undefined or null.
The error occurs when trying to open programmatically created markdown files immediately after creation.## External editorsYes, files open correctly in:- Notepad++
PowerShell (Get-Content)
VS Code (if installed)
Windows Notepad
Files exist, have correct content and encoding, and are readable by other tools. The issue is Cursor-specific.## Filename patternsAffects all .md files created programmatically:- Files with spaces: MD file creation issue.md — fails if created programmatically
Files with hyphens: ad-reporting.md — fails if created programmatically
Simple names: test.md — fails if created programmatically
No special characters required; any programmatically created file fails
Files manually created in Cursor (File > New) work immediately.## File pathsIssue occurs at:- D:\inetpub\wwwroot\askARTreact\docs\admin\reports\ad-reporting.md
Any path in the workspace where files are created programmatically
Extension testingTested with cursor --disable-extensions: issue persists. This appears to be a core Cursor IDE issue, not extension-related.## Root cause analysisAfter testing:1. Problem: Files created programmatically (via AI write tool, PowerShell, etc.) cannot be opened in Cursor immediately. They show:
“Unable to retrieve document from URI”
“Assertion Failed: Argument is ‘undefined’ or ‘null’”
Workaround: Restarting Cursor IDE allows the files to open. This suggests a file system watcher cache issue.
Solution found: Files manually created in Cursor (File > New, then save) open immediately and remain accessible. Populating those files programmatically works fine.
Root cause hypothesis: Cursor’s Electron-based file system watcher on Windows is not registering programmatically created files. The watcher relies on OS-level file system events that may not fire for files created by external tools. Restarting forces a full file system rescan, which registers the files.
Regression: This started after upgrading to Cursor 2.0. The previous version did not have this issue.
Evidence- Programmatically created files fail to open immediately
Same files open after Cursor restart
Same files open in external editors immediately
Manually created files work immediately
Issue affects all programmatically created .md files, regardless of filename pattern
Issue persists with all extensions disabled
Not related to file encoding, content, or permissions
RecommendationThis appears to be a regression in Cursor 2.0’s file system watcher. Please investigate:1. The file system watcher implementation on Windows
How programmatically created files are registered
Why manually created files are immediately accessible while programmatically created files are not
The workaround (manual file creation) is functional but not ideal for workflows that rely on programmatic file creation.Please let me know if you need additional details or test cases.
Same here — I use Cursor to generate and update many Markdown files, and since the major update, I’ve been running into this issue every time after an agent update or when generating a Markdown file. As a workaround, I have to close the file, accept the changes blindly, and then reopen it. Cursor becomes practically unusable this way. Please fix it as soon as possible.
Title: Markdown preview fails with “Assertion Failed” error after AI tool modifications
Description
Markdown files that are created or modified using Cursor’s AI assistant tools (write and search_replace) become unrenderable in Cursor’s markdown preview pane, showing an “Assertion Failed: Argument is undefined or null” error. The files remain valid markdown and can be opened in the raw markdown editor.
Symptoms
Error Message: “Assertion Failed: Argument is undefined or null”
Location: Markdown preview pane when attempting to open .md files
Files Affected: Multiple markdown documentation files in a git-tracked workspace
Content: Files are syntactically valid markdown but fail to render in preview
Steps to Reproduce
Steps to Reproduce
Open Cursor in a git-tracked workspace with markdown files
Use AI assistant to create a new markdown file with the write tool
Example: Create docs/status/TEST-FILE.md with markdown content
Attempt to open the file in Cursor’s markdown preview
Result: “Assertion Failed” error appears instead of rendered preview
OR
Have an existing, working markdown file in the workspace
Use AI assistant’s search_replace tool to modify the file
Attempt to reopen the file in Cursor’s markdown preview
Result: File that previously worked now shows “Assertion Failed” error
Expected Behavior
Expected Behavior
Markdown files created or modified by Cursor’s AI tools should render normally in the markdown preview pane, just like manually edited files.
Actual Behavior
Files become corrupted in a way that prevents Cursor’s markdown preview from rendering them, even though:
The markdown syntax is valid
The files can be opened in the raw markdown editor
Multiple markdown documentation files in the docs/ directory became unrenderable after AI tool modifications. Example file docs/status/RESUME-HERE.md can be provided if needed for debugging.
Impact
Severity: Medium - Prevents normal usage of markdown preview feature
Workaround Available: Yes, but tedious (must manually fix each file)
Frequency: Consistent - happens every time AI tools modify markdown files
User Impact: Disrupts workflow, requires manual intervention to fix files
Additional Notes
This appears to be a bug in how Cursor’s AI tools (write, search_replace) interact with Cursor’s markdown preview metadata/caching system. The tools create or modify files in a way that Cursor’s preview can’t handle, even though the files are technically valid.
Hypothesis: The AI tools may be bypassing or not properly updating some internal Cursor file tracking/indexing mechanism that the markdown preview relies on.
Reproduction Reliability
Highly reproducible - Happened consistently across multiple sessions and multiple files
In my case, the issues comes from the “Office Viewer” extension, that bug only appeared since cursor 2.0.
To temporarily solve the issue:
Disable Office Viewer, reload extension, open file to confirm, then you can reactivate Office Viewer and reopen the file (if you really need that view)
Been an issue for me as well.
All started after the 2.0 update.
workbench.desktop.main.js:55 ERR Unable to retrieve document from URI 'file:///home/kwickell/code/Playpilot/n8n/memory-bank/activeContext.md': Error: Unable to retrieve document from URI 'file:///home/kwickell/code/Playpilot/n8n/memory-bank/activeContext.md'
at uUt.getDocument (file:///usr/share/cursor/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:161:1748624)
at nUt.$resolveCustomEditor (file:///usr/share/cursor/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:161:1736839)
at i1e._doInvokeHandler (file:///usr/share/cursor/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:46:125366)
at i1e._invokeHandler (file:///usr/share/cursor/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:46:125108)
at i1e._receiveRequest (file:///usr/share/cursor/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:46:123822)
at i1e._receiveOneMessage (file:///usr/share/cursor/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:46:122698)
at Jae.value (file:///usr/share/cursor/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:46:120794)
at J._deliver (file:///usr/share/cursor/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:29:2961)
at J.fire (file:///usr/share/cursor/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:29:3282)
at Do.fire (file:///usr/share/cursor/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:46:10994)
at Jae.value (file:///usr/share/cursor/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:673:14540)
at J._deliver (file:///usr/share/cursor/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:29:2961)
at J.fire (file:///usr/share/cursor/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:29:3282)
at Do.fire (file:///usr/share/cursor/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:46:10994)
at MessagePortMain.<anonymous> (file:///usr/share/cursor/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:673:12739)
at MessagePortMain.emit (node:events:519:28)
at MessagePortMain._internalPort.emit (node:electron/js2c/utility_init:2:2949) Error: Unable to retrieve document from URI 'file:///home/kwickell/code/Playpilot/n8n/memory-bank/activeContext.md'
workbench.desktop.main.js:55 ERR cbu: Assertion Failed: Argument is `undefined` or `null`.
at zg (vscode-file://vscode-app/usr/share/cursor/resources/app/out/vs/workbench/workbench.desktop.main.js:29:246)
at ec (vscode-file://vscode-app/usr/share/cursor/resources/app/out/vs/workbench/workbench.desktop.main.js:29:1268)
at pB.resolve (vscode-file://vscode-app/usr/share/cursor/resources/app/out/vs/workbench/workbench.desktop.main.js:4966:9286)
at async jqe.setInput (vscode-file://vscode-app/usr/share/cursor/resources/app/out/vs/workbench/workbench.desktop.main.js:4965:10537)
at async qzn.doSetInput (vscode-file://vscode-app/usr/share/cursor/resources/app/out/vs/workbench/workbench.desktop.main.js:810:63891)
at async qzn.doOpenEditor (vscode-file://vscode-app/usr/share/cursor/resources/app/out/vs/workbench/workbench.desktop.main.js:810:61632)
at async qzn.openEditor (vscode-file://vscode-app/usr/share/cursor/resources/app/out/vs/workbench/workbench.desktop.main.js:810:60557)
at async vscode-file://vscode-app/usr/share/cursor/resources/app/out/vs/workbench/workbench.desktop.main.js:922:37085
at async $Dt.value (vscode-file://vscode-app/usr/share/cursor/resources/app/out/vs/workbench/workbench.desktop.main.js:938:46814)