首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Vite磁盘缓存问题

Vite磁盘缓存问题
EN

Stack Overflow用户
提问于 2022-01-04 14:42:58
回答 1查看 2.8K关注 0票数 7

我有一个使用vitevue 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)

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

我有办法解决这个问题吗?我试着删除节点模块和纱线锁,并运行纱线安装模块,但问题仍然存在。

EN

回答 1

Stack Overflow用户

发布于 2022-01-11 07:17:27

这似乎是一个带有vite-eslint的已知问题

可以使用以下行禁用vite.cofig文件中的缓存:

代码语言:javascript
复制
eslintPlugin({ cache: false });
票数 8
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/70580524

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档