我有一个使用vite和vue 3作为前端的项目。它还使用eslint。有时候,当我运行代码时,它会像这样抛出错误:

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)
但是,一旦修复了代码并保存,它就不会检测到更新的文件。(但它确实会自动运行)。

我有办法解决这个问题吗?我试着删除节点模块和纱线锁,并运行纱线安装模块,但问题仍然存在。
发布于 2022-01-11 07:17:27
https://stackoverflow.com/questions/70580524
复制相似问题