#Page won't refresh

1 messages · Page 1 of 1 (latest)

cosmic sonnet
#

We have vite set up with HMR through Docker.
When i start my Docker container, the page loads (takes some time to get the secure url working), and shows the correct stuff - twig and css coded content.
Now randomly it seems to work that when I update a css file the site live reloads. But after a few times, it stops. No matter what file I then save, it won't show the changes on the browser.
I have to fully shut down the container and restart it for any of the changes to show.

Now this doesn't happen all the time. Some times it'll work for upwards of an hour, then suddenly stop refreshing. Sometimes it takes a full Docker app relaunch to start showing live updates, sometimes it takes a full computer restart.

Other times it won't refresh at all on a css file save, but then randomly does when I save the parent css file (I import individual css files into one main index.css file).

Is this something that people experience randomly, or just me?

I have yet to find a trigger for the problem to happen.

jovial smelt
#

Are you using https or http?

#

If you are using https, are you using a valid or invalid ssl certificate?

cosmic sonnet
#

https

Looks to be invalid. I'm on a mac, and have yet to figure how to get a stable ssl cert working locally.

cosmic sonnet
#

But the fact that it randomly does work then stops is what is getting me confused. I see no reasoning why to suddenly stop updating.

jovial smelt
#

You need to use a valid SSL since an invalid SSL will not cache correctly in the browser

#

in macOS you can add your cert to your keychain

#

you could also manually add it from the CLI which you might want to add to any 'setup.sh' scripts for your app

security add-trusted-cert -d -r trustRoot -k ~/Library/Keychains/login.keychain-db your-proxy.cer
#

If you do it in the UI, you need to click 'get info' then update the trust and set it to be always trusted.

#

you can run a curl command to see if the cert is not trusted then do the install with the above, e.g., curl -v https://localhost:3000 2>&1 </dev/null | grep "SSL certificate problem: self signed certificate"

jovial smelt
#

If the above doesn’t work, let me know, there might be something else wrong with your ssl that you can see in chrome in the dev panel under security.. this means you would need to generate more valid cert

cosmic sonnet
#

@jovial smelt Thanks for the replies. I'm useless when it comes to setting up certs locally. Question - when i run the security add-trusted-cert.... command, I get an "Error reading file XXXXX.cer" message. Even if a export the .cer file to a different folder (just to test) and run the command to that folder, it gives the same error.
So i guess I'm 1)not creating the cert properly or 2)not understanding how to call it directly.....

jovial smelt
#

Can you try opening the keychain access app in macOS then click import from the menu instead? ThEn you won’t need to run the cli command

#

You might also just be able to drag and drop the cer file into keychain access from the finder too

#

If you do this you will need to change the trust level by clicking get info for the cert

cosmic sonnet
#

But where do I get the cert file to begin with?