Issues and errors in Bolt
Before you start, try the following:
Prompt Bolt:
The preview is not showing, please fix this.
This may resolve the issue in some but not all cases. If this doesn’t resolve the issue, repeated prompting won’t be successful. Don’t make repeated attempts, as this uses up tokens.
When using LLMs, break big changes into smaller pieces. Focus on one area or feature at a time, instead of trying to do many things at once.
For each change, provide a specific request. Be clear about what part of the app you’re working on, don’t assume Bolt remembers previous parts of the conversation, and try to show Bolt what you want.
Prompt effectively contains more detailed guidance to writing effective prompts.
You can use the following methods to reduce the size of your project to address the issue where your project exceeds the total supported prompt size.
If you’re new to AI and aren’t familiar with prompting, or the limitations on how much information the AI can handle, Introduction to LLMs gives a quick intro to key concepts. You may also want to learn about Prompting effectively and Maximizing token efficiency.
Bolt uses a tool called Knip to perform the cleanup. You can run this when prompted by Bolt, or run it manually at any time.
Before proceeding, back up your project using both of these methods:
From the left-side panel, select your project. Then, click Export > Download located at the center top of the page.
Now, from the drop-down, click Duplicate to create a fresh copy of your project in Bolt.
Automatic cleanup when prompted:
If your Bolt project exceeds the context window (200k tokens for free accounts, 500k for paid accounts), Bolt notifies you in the chat, saying Project size exceeded. Click Remove unused files to run the cleanup.
Manually run the cleanup:
In the Bolt terminal run the following command:
npx knip --production --fix --allow-remove-files
Check the output in the terminal to see if the command ran successfully. This command removes unnecessary files from the codebase, which reduces the project size.
Open the Bolt terminal
.bolt/ignore
fileIn the .bolt/ignore
file, list any files or folders that Bolt should exclude from the AI context window.
.bolt
directory, click ignore
to open the file in the editor.ignore
file, right-click the .bolt
directory, then click New File…. Name the file ignore
.*
as a wildcard. For example: to ignore all files in a directory called test
, write test/*
in your ignore
file. These files are now completely invisible to the AI, which frees up space in the context window.Hiding files from the AI can have unintended consequences, as the AI is no longer aware of your entire project. This approach is powerful, but is only recommended for advanced users who can make informed decisions about what can safely be excluded, and can understand and resolve issues that may arise from this approach.
Break a large app into smaller chunks, and glue it all back together outside of Bolt later. For example, separating the backend and frontend into different projects is a common developer pattern. Be careful doing this if you don’t have experience as a developer.
If the AI seems stuck or unresponsive to commands, resetting the AI context window can help. To do this, open your and duplicate your project, then work in the new copy of the project. If you want to keep some information from the chat, create a summary of the old chat.
Get the AI to summarize your chat history:
Please generate a short summary of our conversation so far
..txt
or .md
file.Then, reset the context window:
In your new project, add the chat summary:
Enter
to upload the file and your prompt.To continue working on a project in a new browser:
If your project is missing, this is a serious bug that requires Bolt’s help to investigate. Contact the support team at [email protected].
This error occurs where there isn’t enough memory available to run the . To free up system memory, close unnecessary applications and browsers tabs.
Bolt relies on WebContainers, a browser based runtime from StackBlitz that enables a full stack development environment in the browser. If you encounter a WebContainer error, try the following: