How to fix: cannot delete code file in Framer
This issue sometimes happens when you've deleted a page containing a code override. Framer therefore thinks the code is still in use and prevents you from deleting the file altogether.
Step 1: change the content of the code file
Whatever was in the code file, replace it with the following code bit. This will add a component named codeFileFix listed in your project
export default function codeFileFix() {
return <div />
}
Step 2: move this component in a new folder
Click the + icon in the Components panel
Select New Folder
See screenshot below showing how it should look like.
3. Remove the New Folder
You can now simply remove the New Folder we just created. This will result in the removal of both the project component and the code file too.
4. Support us!
If this article helped you solve your issue, consider one of the following method to support us:
Follow Framer Labs here on Substack