Why isn't CSS loading on my preview page in Shopify CLI?

Hello, I`m using Shopify CLI to create a theme;

When I ran it and saw locally using http://127.0.0.1:9292, the style applied correctly; when I tried the preview URL, there was no style.

I`ve checked, and the CSS file is included in the page, but it is not affecting the HTML.

How can I fix it?

PS: I’m using Tailwind CSS, but even the simplest CSS without any framework is not working either.

I don’t know what put the CSS there, but here is what was going on, my .shopifyignore was like this:

package.json
package-lock.json

css
node_modules

I removed the CSS from it, and it worked.

thanks

2 Likes

Hi. I’m having the same issue. Where do I find the .shopifyignore file? Thanks.

In project root

This worked for me, thanks!

Thanks :+1:

Do we need to push this into the actual code base/environment, or if I edit this file locally and run the CLI it works?

Mine has src/ inside it, which is the folder that contains the CSS/JS on my project, bu locally editing it and running the CLI to generate the preview didn’t help. I can only see CSS/JS on my local device, if I try to share the link to a phone or someone else, it loads without CSS/JS

It worked. Thanks

try running shopify theme push