I have a fresh install of Sage 10 per the Docs. I’m trying to wrap my head around the workflow.
When I run yarn dev, I get no errors and although it takes a couple of minutes to compile, it reports “watching project sources (and 25 other files)”. Am I correct that browser-sync should be running at this point? When I make changes to any of the template files in resources, my browser is not refreshed.
When yarn dev is (supposedly) running, if I change a CSS class, in page.blade.php, for example, to some standard tailwind.css class that wasn’t present during compile, the displayed styling will return to default (black text or white background), even if that class exists in the app.xxxxx.css file in public/css. When I stop and then re-start yarn dev, the new classes are updated.
I’m coming from a standard Sass/Gulp environment, so I might just be missing something obvious in how Tailwind works.
Where are those source files? WSL? Mac OS? Linux? In a VM? This is relevant, as crossing different file systems can cause issues with watching file changes.
Does anyone have any ideas where I might look to toubleshoot this issue?
I’m running WSL from the mounted root of the theme directory. When I run yarn dev, this is my output:
I’m guessing this is related to file watch on a mounted volume in WSL 1 – which seems kind of broken, to me.
I would probably upgrade to WSL2 which doesn’t seem to suffer this. But, in the context of WSL1 you can turn on polling to strong arm changes changes into being recognized:
Depending on the number of files being watched it can start to overwhelm container resources, so you may need to adjust the polling interval as you go (expressed in ms):
I am experiencing this same issue on a new MacBook M2 chip machine.
Sometimes the code will inject and refresh and sometimes it won’t.
It’s to the point now where every time I make a change to a blade file, it does not inject and if I refresh the page manually, I get the runtime.js error:
file_get_contents(/srv/www/coloradoshadesystems.com/current/web/app/themes/coloradoshadesystems/public/js/runtime.js): Failed to open stream: No such file or directory
Once I run yarn bud build and refresh, it’s all good until I make a new change and refresh again.
Upon further investigation, if I stop watching the dev url, make changes and just refresh the proxy url manually, then I do not see the runtime.js error but of course, it gets old having to refresh all the time manually.
So two days ago I ended up changing the port from :3000 to :3333, running yarn dev and I was off to the races. Everything appeared to be working well
Once in a while, it would run into the runtime error, close out my dev connection, restart and be good for a while again.
This morning, I was working on getting some tools setup (ACF Pro, ACF Composer) and begin to build out some blocks, when suddenly I am getting the runtime error on every save again. Injecting / reloading was not working, so I did it manually.
Once I changed the port again, from :3333 to :4444, all is well now, once again, for now anyways…
Not sure how to describe this any better… but if I am able to change the port around and continue working for a few days at a time before I need to change it again, that’s fine. Better than before.
***EDIT
Nevermind, spoke too soon. It’s throwing the runtime.js error after every save. I’ve changed the port a few different times now and its not helping.
Seems to have went back to bad after installing the the tools mentioned on my last post.
Nope, in fact, now when I attempt to open the localhost address, it just redirects me back to the proxy url and I have to manually refresh to see my changes. Luckily I am not currently getting any runtime errors.