Bug Description
When using Cursor’s AI to create or edit TypeScript files, invisible characters (BOM/Unicode markers) are being added to the files. This causes Vite/esbuild to fail with “Unexpected ‘�’” errors.
Steps to Reproduce
- Create or edit a TypeScript file using Cursor’s AI assistance
- Try to run the development server (npm run dev)
- Build fails with “Unexpected ‘�’” error
- Even after fixing files in VS Code, the corruption returns when using Cursor’s AI to edit the files
Error Messages
Error: Failed to scan for dependencies from entries:
[File path]
X [ERROR] Unexpected “�”
src/pages/blog-generators/GardeningBlogGenerator.tsx:1:0:
1 │ ��// Gardening Blog Generator
╵ ~
Impact
- Development server cannot start
- Files need to be constantly cleaned of invisible characters
- Switching between editors creates inconsistency in development
- AI assistance becomes counterproductive as it reintroduces the corruption
Environment
- OS: Windows 10
- Cursor Version: x64-0.47.8
- Project Type: React/TypeScript with Vite
- Build Tools: Vite, esbuild
Additional Context
- This happens consistently with TypeScript files
- The issue persists even after cleaning files in other editors
- The invisible characters are reintroduced when using Cursor’s AI to edit files
I’m not a coder, so I’m using no-code (AI-Assistance) to build my project. This ate up several credits (cost money) before I realized it was a bug.