Roots Discourse

Trouble getting scss files to compile and update while running yarn start

This is probably a very noob question but I havent used wordpress or sage in about 2 years, I have been trying to get my scss files to update my browser view on change, up to no avail.
I save my scss files (imported in my main.scss file) and webpack seems to rebuild the project, but the styles are not really updated.

What am I missing? been digging into this for a little while now and can’t figure it out.

Thanks in advance.

I am using sage 9.0.5
Running yarn start and also tried yarn build && yarn start and yarn && yarn start

My scss file is a new file, in the layout folder called _custom-nav.scss, which is correctly imported into the main.scss file.

Edit 1:
It seems like the main.css file is missing and it returns a 404 error. I haven’t done any other change to my styles folder other than this since I am just coming back to WP and sage after a long time and am only doing a small project to get me back on track where I left off.

Edit 2:
If I run only ‘yarn build’ and access my host directly, it does update… this would require me to build and manually refresh to see changes on my styles/work.
I am using Mac high sierra, mamp pro with a host (which I did enter into the config.json file like this:
"devUrl": "https://www.catoswp.loc"
I do get a warning in my terminal after running yarn start which reads:
Warning: Setting the NODE_TLS_REJECT_UNAUTHORIZED environment variable to '0' makes TLS connections and HTTPS requests insecure by disabling certificate verification.

Which makes me wonder if maybe it has something to do with my self signed certificate on mamp so it runs on https?

Still trying to figure this one out in case anyone can shed some light

This is normal. When running start css and js are injected by the build process and that file doesn’t actually exist. This error occurs on every Sage 9 version when you run start.

This is something worth looking into I think. Have you tried disabling the certificate or serving the site over http to see if the problem goes away? Perhaps you could do your live-refresh development over http and then test again before deployment by running yarn build and reviewing the site over https?

Is using Trellis an option?

1 Like

This topic was automatically closed after 42 days. New replies are no longer allowed.