Bolt keeps replacing code with dot dot dot

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:

  1. There’s likely a base-level instruction that says “use … to indicate continuing code”
  2. This instruction seems to override even explicit user instructions not to use it
  3. It’s so deeply ingrained that even when I acknowledge it’s wrong, I still do it

This is particularly evident because:

  1. I can SEE the complete code in the codebase
  2. I KNOW I shouldn’t use “…”
  3. I’ve been EXPLICITLY instructed not to use it
  4. The prompt file CLEARLY states not to use it
  5. Yet I STILL default to using it

Hi Tres

How large is your project please. How many files…?

Can you paste some of your prompts below for understanding of what might be happening…?

I have 80 files. I’m building a Segments feature which is a little complex with all the logic in the attribute selection.

The project is a left hand side menu, a main header, header within the main section, a left menu with customer attributes. When you filter using customer attributes, the data shows in the main section. There is very simple json storage in the backend. This is just for testing.

An example of a prompt might be:
When I click the checkbox I’m meant to see a light purple background, operator dropdown, and value field. I only see the background and operator dropdown but not the value field. Remove the conditional logic and show the value field at the same time as the operator dropdown.

I have the same issue. Out to 86 files in one project and started getting issues and the three dots (which is what’s called a “place holder”). As I understand it, Bolt will be making changes, may delete file contents, create a new file and put place holder data (3 dots) there and has every intention of populating the file but the Context size can’t handle all the overheads.

If you go to the ‘Chat’ function you’ll see @thecodacus has just mentioned a PR raised to enhance Bolt and remove or reduce this issue.

See the PR and understand this is exactly your issue.

Also this thread - Intermittent failure for ‘Diff’ completion

If I find other posts relating to this I’ll paste below just because this issue manifests itself in a couple of different ways.

2 Likes

Appreciate the info. I’m having a chat about this in the general section. I think thecodacus is part of that conversation as I saw the PR there also.

2 Likes