Vite disk cache issue
P粉776412597
P粉776412597 2024-01-28 20:04:01
0
1
402

I have a project using vite and vue 3 as the frontend. It also uses eslint. Sometimes when I run the code it throws an error like this:

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 './components/SdDoughnutChart.vue' import/order

✖ 1 issue (1 error, 0 warning)

1 error and 0 warnings may be fixable using the "--fix" option.

Plug-in:vite:eslint

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

at format error (/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 Asynchronous 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, it doesn't detect the updated file. (It will run automatically though).

Is there any way to solve this problem? I tried removing node modules and yarn-lock and running yarn to install the modules, but the problem persists.

P粉776412597
P粉776412597

reply all(1)
P粉442576165

This appears to be a Known issue of the vite-eslint -plugin.

You can disable caching in the vite.cofig file using the following lines:

eslintPlugin({ cache: false });
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!