Page not found when serving theme locally

Hello, I recently have this problem and I don’t know what might have caused it. I have a local copy of my shop’s theme, which I’m serving via “shopify theme dev”. It says I should go to 127.0.0.1:9292 to preview the theme, but all I see there is a 404 not found page, and the console output also shows 404 not found. Same with the URL that I get when calling the comman. Also, when navigating to the shop domain in the same browser, is also shows a 404 page, which doesn’t make sense. I can reach the shop in other browsers where I haven’t navigated to the dev domain. What might be the issue here?

Hey @maximhh,

this page is generally shown if your previewed theme does not have all the required files to properly display the page.

Can you check if you have a valid “layout/theme.liquid”, “config/settings_data.json”, “config/settings_schema.json” and at least a “templates/index.json” file present inside the directory you are currently previewing?

If so - do you get any errors or warnings when running shopify theme dev?

Best regards,

Kevin :hatching_chick:

Hi, it eventually started working again for some reason, it showed the store with a hint at the bottom that it’s a local preview. But now I have the same issue again. I run shopify theme dev, it all looks fine in the console, but then I only get 404 errors. Not even sure what happens in the background that it redirects me to my public store URL when I navigate to localhost or the cryptic URL that the shopify theme dev command returns.

Your 404 errors likely stem from browser cookie conflicts between local and production environments - try using an incognito window, clearing cookies, refreshing authentication with shopify logout then shopify login, using a different port with --port=9293, or checking your theme directory structure for validit

Probably recommending you to someone who can help further with this issue? I could include details about your expertise with Shopify theme development if you provide some information about your background.

It says there is no command “shopify login”.