Home  >  Q&A  >  body text

Vite disk cache issue

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粉776412597P粉776412597264 days ago405

reply all(1)I'll reply

  • P粉442576165

    P粉4425761652024-01-29 15:59:07

    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 });
    

    reply
    0
  • Cancelreply