I keep getting these types of errors. Bolt keeps rewriting files and replacing all the code with “…”. This happens every couple of instructions and every time, bolt has to go back and rewrite all the code back into the file and replace the “…”.
I’ve tried updating the prompt file with additional information to prevent this but it keeps happening.
[plugin:vite:react-babel] /home/project/src/components/SimpleUserList.tsx: Unexpected token (1:0)
2 |
/home/project/src/components/SimpleUserList.tsx:1:0
1 | …
| ^
2 |
at constructor (file:///home/project/node_modules/@babel/parser/lib/index.js#cjs:359:19)
at TypeScriptParserMixin.raise (file:///home/project/node_modules/@babel/parser/lib/index.js#cjs:3327:19)
at TypeScriptParserMixin.unexpected (file:///home/project/node_modules/@babel/parser/lib/index.js#cjs:3347:16)
at TypeScriptParserMixin.parseExprAtom (file:///home/project/node_modules/@babel/parser/lib/index.js#cjs:11102:16)
at TypeScriptParserMixin.parseExprAtom (file:///home/project/node_modules/@babel/parser/lib/index.js#cjs:6937:20)
at TypeScriptParserMixin.parseExprSubscripts (file:///home/project/node_modules/@babel/parser/lib/index.js#cjs:10734:23)
at TypeScriptParserMixin.parseUpdate (file:///home/project/node_modules/@babel/parser/lib/index.js#cjs:10719:21)
at TypeScriptParserMixin.parseMaybeUnary (file:///home/project/node_modules/@babel/parser/lib/index.js#cjs:10699:23)
at TypeScriptParserMixin.parseMaybeUnary (file:///home/project/node_modules/@babel/parser/lib/index.js#cjs:9649:18)
at TypeScriptParserMixin.parseMaybeUnaryOrPrivate (file:///home/project/node_modules/@babel/parser/lib/index.js#cjs:105
After asking Claude a couple of questions, this was the response:
You’ve hit on something crucial. You’re right - there must be some fundamental instruction or pattern in my training that makes me default to using “…” as a shortcut, despite explicit instructions not to do so.
This behavior suggests:
- There’s likely a base-level instruction that says “use … to indicate continuing code”
- This instruction seems to override even explicit user instructions not to use it
- It’s so deeply ingrained that even when I acknowledge it’s wrong, I still do it
This is particularly evident because:
- I can SEE the complete code in the codebase
- I KNOW I shouldn’t use “…”
- I’ve been EXPLICITLY instructed not to use it
- The prompt file CLEARLY states not to use it
- Yet I STILL default to using it