-
-
Notifications
You must be signed in to change notification settings - Fork 6.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
Bug with Safari #1132
Comments
So weird. It doesn't have to do anything with input, it behaves same for anything you change. Hot reload works, but after refresh you get old contents. I figured if I refresh http://localhost:8080/app.js in another tab I get latest bundle served and manual refresh works again. But not always 🌘 Even disabling cache (see Safari 11.1 below) won't help :/ It looks like Safari 11.1 caching issue to me. My wild guess would be they introduced regressions with implementing service workers. 👹 |
I'm facing the same bug. It is such a problem that I can't use Safari to develop with Vue anymore. |
This is definitely a bug in Safari itself... |
FYI: Confirming issue with Safari 11.1.2. Also Safari Tech Preview Release 60 (Safari 12.0, WebKit 13606.1.23.1). Works fine in Chrome. |
I was facing the same annoying bug with Safari (both desktop and mobile), and since "app.js" was not updated , I had to add this code in "vue.config.js" to make it work. module.exports = {
chainWebpack: config => {
if (process.env.NODE_ENV === 'development') {
config
.output
.filename('[name].[hash].js')
.end()
}
}
} |
to circumvent a Safari caching issue closes vuejs#2391, vuejs#1132
Same issue here using safari 13.0.4 on Mac OS Catalina 10.15.2 |
Same issue |
Same issue here, Safari 13.0.4 on macOS 10.15.2 and Safari hot-reloads correctly on file changes but then reverts back to an older version of the site upon a refresh. |
Same issue with Safari 13.1 (and older too) and |
First day using Vue and ran into this issue with Safari 13.1.1 trying to update the Hello World project and nothing changes. |
@rskvazh @chrisbartow It is not a bug, Safari caching engine works differently and is currently in not in sync with how vue-loader works, so it'll always cache the first version and keep it persistent. You can change this behaviour in the developers tools. But I'd advices to use chrome or use Safari's incognito mode. |
There's a problem with the cache. it's a whole thing (vuejs/vue-cli#1132)
This is still an issue as of Safari 14.0.1 and vue-cli 4.5.9. I filed a WebKit bug report https://bugs.webkit.org/show_bug.cgi?id=219323. In the meantime, I clear the cache before each reload.
Thanks to @bfanger for this tip. P.S. @Twinpix's workaround is an alternative to clearing the cache before every reload, but apparently it can cause a memory leak. Adding the hash to the query string instead of the file name is another option, but can cause issues with some webpack loaders. See commits 33dad39, 52dbdf8, and 0909bc8. |
Unfortunately this is making me think twice about using Vue. Just rebuilt my site with VueJS 3 and after deployment discovered Safari is choking. desktop Chrome OK, mobile Chrome OK, mobile Safari OK, desktop Safari NOPE! See alot of timeouts BUT ONLY on Safari. |
@panderson1000 This bug is limited to an issue with local development using vue-cli. It does not affect deployed code. Perhaps you can post on the vue forum https://forum.vuejs.org with your issue. |
First day with vue and still got this error with safari version 14.0.3. Kinda annoying to clear the cache before reload. |
@FakieKickflip You should better report this bug to Apple and insist on fixing it as this is a problem with Safari and not with Vue CLI. |
I believe this is not a problem in safari, I developed several applications that use webpack and run normally. maybe vue doesn't fully support safari by default. this comment is at least helpful #1132 (comment) |
This issue still persists on v14.1. Since this is caching related, I don't think it will ever get "fixed" because of different caching methods of Safari, so there is nothing to fix from Safari's side. Emptying the caches and reloading works, but since the deployed code doesn't cause problems, I would suggest to use another browser for active development and just do a final check with Safari when the developed feature is finished. |
Still an issue. Clearing cache does NOT necessarily fix this issue. As crazy as that sounds. I think it may possibly be Service Worker related and here's what's happening. Even destroying the development/localhost tab and creating a new one may not necessarily work. The first page you get served might be the correct updated one. But after you interact with the page or trigger a hot reload update, the page will REVERT BACK to an old version. This is crazy behaviour. I'm not exactly sure why or how but it smells like Service Worker related to me. Things that will not work:
The above may work temporarily, but if you interact or issue a HMR update after loading, the page CAN REVERT BACK to an older version. I found this out after having a On Chrome at the same time everything was working fine, I was served the most updated version. I'm not exactly sure what's going on but seems like possibly Service Worker related? Safari Version 14.0.3 (16610.4.3.1.7) node v14.16.0 vue 2 |
Same thing on Safari 14.1 (15611.1.21.161.7, 15611) on Catalina 10.15.7 and Vue CLI 4.5.12 Quite annoying. |
I am having the same issue with my m1 8g Macbook Pro. If I clear the cache I will see my new changes but pretty annoying to have to keep clearing the cache for each save or change. |
There is nothing the vue-cli team can do, it's a bug in Safari: https://bugs.webkit.org/show_bug.cgi?id=219323 It's sad, but Safari simply doesn't comply with the http spec and also disregards the disable-cache devtool setting. Instead of commenting in this thread, report the issue in channels that are read by the Safari browser developers/dev-advocates. |
@bfanger Why does this only happen with Vue on Safari? And not with any other devtool? |
i have the same issue. I thought my css wasn't working on mobile only to find out it's a vue bug. @vue/cli 4.5.13 |
+1, it's a quite frustrating first user experience with the project. |
+1 |
Yeah ran into this today with Safari 14.1.2 (16611.3.10.1.3) |
Same issue, I'm on Safari 14.1.1 |
Thanks for this, mate/ |
@Twinpix config to Update: so it seemed to work, but then it happened again a bit later so perhaps this isn't a rock solid solution. |
Hi, @speg. They already tried it and ran into issues, so they reverted it. See my comment above #1132 (comment) for a list of commits if you're curious about the details. |
This comment's config was no longer working for me so I added chainWebpack: config => {
if (process.env.NODE_ENV === 'development') {
config
.output
.filename('[name].[hash].js')
.chunkFilename('[name].[hash].js')
.end()
}
}, |
This fixed my problem today |
Version
3.0.0-beta.6
Reproduction link
https://github.com/shammelburg/vue-cli-test
Steps to reproduce
Once you've cloned the project,
What is expected?
When I refresh the browser the app needs to give me the latest build from when I saved the changes.
What is actually happening?
When making changes to a .vue file, eg. changing an input in the template,
the browser updates initially but when you refresh the browser manually it seems to return to first time you run 'npm run serve'.
When starting and stopping the app through terminal the app runs ok.
A similar things happens when changing property names.
I've ran this on Chrome and it works fine.
I'm running this on my Mac.
The text was updated successfully, but these errors were encountered: