-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Npm run dev, isn't watching for global.css #2965
Comments
@taylorosbourne Could you include your |
Package.json { and rollup.config.js import svelte from 'rollup-plugin-svelte'; const production = !process.env.ROLLUP_WATCH; export default {
}; |
@taylorosbourne In your configuration, Rollup is setup to watch files in the watch: {
clearScreen: false,
// Add this line to your config
include: "public/global.css"
} |
@s0kil I added that line to the config. However, it's still losing my styles when I make a change to a svelte file. |
Not sure what you are trying to achieve here. |
What was the solution here? It's still the same for me. Steps to reproduce:
Same behaviour after I made the recommended change in I used Chrome on Windows (webpage served from Ubuntu 18.04 in WSL) for testing this. The solution for me is to reload the webpage with caching disabled ( |
@fschuetz04 I don't actually know what the solution is. I made the change in rollup.config.js and it didn't seem like anything had changed so I gave up. The next day, I reopened the project and could no longer recreate the issue. For whatever reason, it was working. I have no idea if the inherent problem is with svelte, or rollup. Sorry to be absolutely no help 😞 |
@taylorosbourne Thanks for your reply! Well I know of one solution, as written before: Reload the webpage with caching disabled (e.g. using |
Experiencing this issue currently. My Svelte styles are not getting applied to select components at all. Noticed that if I load the page without having Chrome DevTools open, it's fine, but as soon as Chrome DevTools is open, my Svelte styles will immediately be removed/reset, without even having to reload the page.. I disabled ALL extensions, no dice. Not an issue in FF though.. ;) |
Pls i am having this issue, has there not been any fix yet,as having to save your global.css and the browser is quite annoying |
If I am understanding you correctly when you would save the "global.css" styles were not refreshing as well. In Google Chrome under the network tab check to see if your browser is caching "global.css'; It was for me and fixed the problem. |
This is still happening. CSS not getting loaded with each refresh. Disabling the cache in Network under devtools does circumvents the problem, but this is not a real solution. Some additional configuration might be required in rollup or the module sirv-cli. After a few trials one of these can be tried:
|
Same here... Is there any solutions ? |
Same problem here, definitely a cache issue |
It's a cache problem, try cmd+shift+r :) |
I just had the same issue. It turned out that the webworker was hanging on to the instance of global.css that it was created with, and not updating it. Empty cache & hard reload would bypass and get the new one but next normal reload would get the old one. Restart server, browser, client machine did not clear it. Shutting down the server and having the webapp continue with the old version pointed me in the right direction. Unregistering the webworker in Application/Webworker (Chrome) cleared the problem. |
I had the same issue. My solution was in rollup.config.js I changed (I use Intellij and before I marked the public folder as a resources root.) |
If none of the above works, I found there were a couple of service workers registered on the dev domain. Removing these solved the issue for me. |
Whenever I save in App.svelte, the styles in my global.css go away. The console output is
[2019-06-06 21:54:56] waiting for changes...
[21:54:57] 200 ─ 0.43ms ─ /bundle.css?livereload=1559872497155
[21:54:57] 200 ─ 0.38ms ─ /
[21:54:57] 200 ─ 0.43ms ─ /bundle.css
[21:54:57] 200 ─ 0.64ms ─ /bundle.js
[21:54:59] 200 ─ 0.46ms ─ /
[21:54:59] 200 ─ 0.15ms ─ /bundle.css
[21:54:59] 200 ─ 0.53ms ─ /bundle.js
[21:54:59] 200 ─ 0.60ms ─ /favicon.png
however, saving in the global.css file will bring them back and console output is this
[2019-06-06 21:55:17] waiting for changes...
[21:55:19] 200 ─ 3.59ms ─ /
[21:55:19] 200 ─ 0.86ms ─ /bundle.css
[21:55:19] 200 ─ 1.22ms ─ /bundle.js
[21:55:19] 200 ─ 0.53ms ─ /favicon.png
[21:55:22] 200 ─ 0.34ms ─ /global.css?livereload=1559872522807
as you can see, saving in App.svelte doesn't reload the global.css file. Is this normal? Sorry, new to svelte. Thanks!
The text was updated successfully, but these errors were encountered: