We can't find the internet
Attempting to reconnect
Something went wrong!
Hang in there while we get back on track
Today, while developing a new feature in my app at work (which is a VueJS based app using Vite as the bundler), I got the following error in the browser console while running the app in dev mode:
504 (Outdated Optimize Dep)
First thing I tried was to do a shift-refresh in Chrome to clear out the cache. Unfortunately, this didn't help.
A quick search on trusty StackOverflow indicated that the problem could
be the Vite cache. I therefor updated the package.json file to include the --force
flag:
{
"scripts": {
"dev": "vite --force",
},
}
I then re-ran the dev
command and the problem was goneβ¦
npm run dev
This cleared out the cache from Vite which was the actual problem. For a list of all Vite CLI flags, you can check the documentation.
If this post was enjoyable or useful for you, please share it! If you have comments, questions, or feedback, you can email my personal email. To get new posts, subscribe use the RSS feed.