Theme preview does not open, claims that key files are missing while they aren't

I have reproduced the issue on the latest CLI version.

Yes, I am on the latest version

I have searched existing posts and this report is not a duplicate.

Yes, this isn’t a duplicate

In which of these areas are you experiencing a problem?

Theme

Expected behavior

To successfully preview the theme that I’m working on.

Actual behavior

Preview link opens a blank page with this error and that doesn’t make any sense because the mentioned files are already in their place.

“Theme cannot be previewed because it’s missing one of these required files: layout/theme.liquid, config/settings_schema.json”

Reproduction steps

shopify theme dev

Verbose output

This is not a problem with the output of the CLI. It outputs the links correctly. But when opening the link, it shows error.

Operating system

Windows 11

CLI version

3.87.4

Shell

Git Bash

Nodejs version

25.2.0

Have you opened the theme in the theme editor in the admin and 100% confirmed all required files are there?

You can run into this sometimes when using the same shop to develop multiple themes. If that’s your case and you’ve already confirmed that all the files are there (as Luke mentions above) then you can try deleting the development theme shopify theme delete -d and running the preview again.

Very strange, but I found that the reason was using double terminals. I’m usually using two terminals side by side, one for running npm commands, another for running theme dev preview. Solution was starting dev preview in single window and opening the second terminal only after the dev preview is ready.