Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Vite disk cache issue

I have a project that uses vite and vue 3 for front end. It also uses eslint. Sometimes when I run the code, it throws me errors like this:

Vite error message

2:26:53 PM [vite] Internal server error: /path/to/project/wt-frontend-2/src/pages/school-districts/PageSsDetails.vue
46:1 error "@/assets/images/school.svg" import should occur before import of "./components/SdDoughnutChart.vue" import/order

✖ 1 problem (1 error, 0 warnings)
1 error and 0 warnings potentially fixable with the "--fix" option.

Plugin: vite:eslint
File: /path/to/project/wt-frontend-2/src/pages/school-districts/PageSsDetails.vue

at formatError (/path/to/project/wt-frontend-2/node_modules/vite/dist/node/chunks/dep-76613303.js:36769:46) at TransformContext.error (/path/to/project/wt-frontend-2/node_modules/vite/dist/node/chunks/dep-76613303.js:36765:19) at TransformContext.transform (/path/to/project/wt-frontend-2/node_modules/vite-plugin-eslint/dist/index.js:87:14) at processTicksAndRejections (internal/process/task_queues.js:95:5) at async Object.transform (/path/to/project/wt-frontend-2/node_modules/vite/dist/node/chunks/dep-76613303.js:36985:30)

However, once I fix the code and save, it does not detect the updated file. (it does automatically run though).

Updated code

Is there a way I could resolve this? I tried deleting node modules and yarn-lock and running yarn to install the modules, but the issue persists.

like image 925
shardul gaikwad Avatar asked Apr 28 '26 23:04

shardul gaikwad


1 Answers

This seems to be a known problem with the vite-eslint-plugin.

You can disable the cache in your vite.cofig file with the following line:

eslintPlugin({ cache: false });
like image 123
James Burgess Avatar answered Apr 30 '26 14:04

James Burgess



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!