Forced to run "wp blade compile" or I get Warning: file_put_contents() ERROR

Hello,

I am starting using Sage, also thanks to @knowler and @strarsis help.

What I am facing now is a browsersync issue, I guess, as, once I update a blade template, unless I launch a wp compile command I keep receiving a warning attached to the page and no updates to the code are reflected…

Warning : file_put_contents(/Users/matteo/Sites/atravisio.localhost.dev/web/app/uploads/cache/733e20a81b3430f917a1ee5ed50ad44dcbe20bee.php): failed to open stream: Permission denied in /Users/matteo/Sites/atravisio.localhost.dev/web/app/themes/av-2021/vendor/illuminate/filesystem/Filesystem.php on line 122

no real premisison though, as if I run wp blade compile the output is correctly updated…

ty

How are you hosting that site? Vagrant? Docker? WAMP? Linux system?

Mysql + PHP on localhost, for now…

remotely it will be hosted by netsons

Why are you running the wp blade compile command after updating Blade templates? In most situations you shouldn’t need to do that, just refreshing the page should be sufficient.

that’s why I am asking in this forum…
even if I have a “watching” message, if I refresh the page no JS nor CSS changes take effect.

I need to re-run yarn start each time :exploding_head:

Any warnings or errors in the JavaScript console on the browsersync’ed page?

Unluckily (but also a bit obviously :wink: ) not! :frowning:

there’s only one strange error:

Failed to load resource: the server responded with a status of 404 (Not Found) https://atravisio.localhost.dev/app/themes/av-2021/dist/styles/main.css

but my styles are applied…
don’t know if this could be a symptom of something weird happening…

This seems to be normal though, the styles are streamed/applied by BrowserSync instead.

so what can I check/do?
working in this way is totally impossible as I have to stop the watcher CTRL + C and then yarn (re)start each time… crazy…
even for a minor JS console log check…
not viabile in this way…

re-edited…
said a stupid thing :frowning:

You may also try:

unfortunately this is already my config:

new BrowserSyncPlugin({
      target,
      open: config.open,
      proxyUrl: config.proxyUrl,
      watch: config.watch,
      delay: 1500,
      advanced: {
        browserSync: {
          cors: true,
        },
      },

same issues…

CHROME EDIT: chrome returns another error.

GET https://my.localhost.dev/__webpack_hmr 404 (Not Found)

safari doesn’t

found the solution.

low chance anyone else would face this one: MY MISTAKE.

instead of going ahead on localhost:3000 URL, I kept working on local path written in nginx config (mysite.localhost.dev).

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