Slate compiled css not uploaded to Shopify server

Solved
Shopify Partner
2 1 0

Hey all,

 

I'm developing my first theme for a client project using the Slate starter theme. When I run yarn start to fire up the Slate local development, I can view the styled version of the site both on localhost and Shopify servers (i.e. my-shop.myshopify.com) but when I exit slate tools, no compiled css is loading on the Shopify server. This is a problem as my client is trying to update the store content but cannot view the styled site on the myshopify.com url. When I view source I can see that only theme.scss.liquid is compiled and referenced in the document head by the following include in theme.liquid:

{% include 'style-tags', layout: 'theme' %}

 

All my non-liquid styles are in theme.scss & slate injects these styles from layout.theme.js running locally. How then am I supposed to get the compiled css from theme.scss up on to Shopify servers?

 

Thanks in advance!

 

 

0 Likes

Success.

Shopify Partner
2 1 0

Problem solved! I just discovered that I needed to run 'yarn build' & then 'yarn deploy' to compile & upload the full theme to Shopify servers, rather than 'yarn start' which just boots up the local Express server: https://shopify.github.io/slate/docs/commands#start

0 Likes
New Member
3 0 0

Hi @bristlebird, I'm having the same issue, I've tried everything so far and can't seem to make it work. 

 

Strange... don't know why it didn't work for you with just deploy as deploy actually runs those two commands if you check under the package.json file

"deploy": "slate-tools build && slate-tools deploy"

 

My problem is actually a larger one, as I cannot see the changes done to the SCSS at all in the frontend. The Hot Module Replacement is not working, plus I cannot get it to deploy to the server so not even that one is working. I'm wondering if you'd have any more insides on the issue you faced? I've just tried swapping

{{ 'theme.scss.css' | asset_url | stylesheet_tag }}

for what you wrote

{% include 'style-tags', layout: 'theme' %}

and still nothing... 

Might it be something related to the file/folder structure of my files somehow? Slate's Docs state that Slate will look for each file in the scripts/layout... and see if there is a matching file in the sr... Do styles have something like this that I'm missing? It's strange though because the file/folder structure is since 

yarn create slate-theme my-new-theme

 

I've lost days already, so annoying that the only useful web tool Shopify provides is fiddly (half local half server) and was put under Low Maintenance (meaning they killed it as @Perrin said here)....

 

Much appreciated if anyone has any idea on what might be happening. 

Cheers all and thank you!

 

0 Likes