gpt4 book ai didi

javascript - Vite磁盘缓存问题

转载 作者:行者123 更新时间:2023-12-05 00:27:30 26 4
gpt4 key购买 nike

我有一个项目使用 vitevue 3对于前端。它还使用 eslint .有时当我运行代码时,它会抛出如下错误:
Vite error message2: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.vueat 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)但是,一旦我修复代码并保存,它就不会检测到更新的文件。 (虽然它会自动运行)。
Updated code
有没有办法解决这个问题?
我尝试删除节点模块和 yarn-lock 并运行 yarn 来安装模块,但问题仍然存在。

最佳答案

这似乎是 known problem使用 vite-eslint-plugin。
您可以在 vite.cofig 中禁用缓存。具有以下行的文件:

eslintPlugin({ cache: false });

关于javascript - Vite磁盘缓存问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/70580524/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com