【发布时间】:2022-01-04 14:42:58
【问题描述】:
我有一个项目使用vite 和vue 3 作为前端。它还使用eslint。有时当我运行代码时,它会抛出如下错误:
2:26:53 PM [vite] Internal server error: /path/to/project/wt-frontend-2/src/pages/school-districts/PageSsDetails.vue46: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)
但是,一旦我修复代码并保存,它就不会检测到更新的文件。 (虽然它会自动运行)。
有什么办法可以解决这个问题吗? 我尝试删除节点模块和 yarn-lock 并运行 yarn 来安装模块,但问题仍然存在。
【问题讨论】:
标签: javascript vue.js vuejs3 rollupjs vite