sha*_*wad 8 javascript vue.js rollupjs vuejs3 vite
我有一个使用vite和vue 3作为前端的项目。它还使用eslint. 有时,当我运行代码时,它会抛出如下错误:
2:26:53 PM [vite] Internal server error: /path/to/project/wt-frontend-2/src/pages/school-districts/PageSsDetails.vue
\n46:1 error "@/assets/images/school.svg" import should occur before import of "./components/SdDoughnutChart.vue" import/order
\xe2\x9c\x96 1 problem (1 error, 0 warnings)
\n 1 error and 0 warnings potentially fixable with the "--fix" option.
Plugin: vite:eslint
\n 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)\n at TransformContext.error (/path/to/project/wt-frontend-2/node_modules/vite/dist/node/chunks/dep-76613303.js:36765:19)\n at TransformContext.transform (/path/to/project/wt-frontend-2/node_modules/vite-plugin-eslint/dist/index.js:87:14)\nat processTicksAndRejections (internal/process/task_queues.js:95:5) \nat async Object.transform (/path/to/project/wt-frontend-2/node_modules/vite/dist/node/chunks/dep-76613303.js:36985:30)
但是,一旦我修复代码并保存,它就不会检测到更新的文件。(不过它确实会自动运行)。
\n\n有没有办法解决这个问题?\n我尝试删除节点模块和yarn-lock并运行yarn来安装模块,但问题仍然存在。
\n这似乎是vite-eslint-plugin 的一个已知问题。
vite.cofig您可以使用以下行禁用文件中的缓存:
eslintPlugin({ cache: false });
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
6544 次 |
| 最近记录: |