Solved

CSS is not loading on the preview page

angeloghiotto
Shopify Partner
36 4 8

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.

Accepted Solution (1)
angeloghiotto
Shopify Partner
36 4 8

This is an accepted solution.

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

View solution in original post

Replies 7 (7)
angeloghiotto
Shopify Partner
36 4 8

This is an accepted solution.

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

mvenadas
Shopify Partner
6 0 3

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

angeloghiotto
Shopify Partner
36 4 8

In project root

mvenadas
Shopify Partner
6 0 3

Thanks 👍

mvze
Shopify Partner
1 0 0

This worked for me, thanks!

 

flep
Shopify Partner
1 0 0

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

ridwan_adekunle
Shopify Partner
4 0 0

It worked. Thanks