79077289

Date: 2024-10-11 08:13:03
Score: 2.5
Natty:
Report link

Having the same issue when using yarn v4, and solved by clearing browser cache, as described in the Vite doc:

Caching

File System Cache

Vite caches the pre-bundled dependencies in node_modules/.vite. It determines whether it needs to re-run the pre-bundling step based on a few sources:

...

If for some reason you want to force Vite to re-bundle deps, you can either start the dev server with the --force command line option, or manually delete the node_modules/.vite cache directory.

Browser Cache

Resolved dependency requests are strongly cached with HTTP headers max-age=31536000,immutable to improve page reload performance during dev. Once cached, these requests will never hit the dev server again. They are auto invalidated by the appended version query if a different version is installed (as reflected in your package manager lockfile). If you want to debug your dependencies by making local edits, you can:

  1. Temporarily disable cache via the Network tab of your browser devtools;
  2. Restart Vite dev server with the --force flag to re-bundle the deps;
  3. Reload the page.

In my case I had to delete the browser data folder, restart browser, then rerun app using vite --force. Clearing site data and doing a hard refresh did not work for me.

Reasons:
  • Blacklisted phrase (1): did not work
  • Long answer (-1):
  • Has code block (-0.5):
  • Me too answer (2.5): Having the same issue
  • Low reputation (0.5):
Posted by: ilharp