我有一个vite几个月前创建的vue3项目,当时它还能正常调试和发布,今天我准备做一点修改,并在运行时报错,所有vue文件都是报错的:[vite] Internal server error: Failed to resolve import "@vue/server-renderer" from "srcApp.vue". Does the file exist?
,我全局搜索,没有文件引用vue/server-renderer
,如何解决这个问题?
[vite] Internal server error: Failed to resolve import "@vue/server-renderer" from "src\App.vue". Does the file exist?
Plugin: vite:import-analysis
File: PATH/vue3-element-admin/src/App.vue
17 |
18 | import { resolveComponent as _resolveComponent, withCtx as _withCtx, createVNode as _createVNode, mergeProps as _mergeProps } from "vue"
19 | import { ssrRenderComponent as _ssrRenderComponent } from "@vue/server-renderer"
| ^
20 |
21 | function _sfc_ssrRender(_ctx, _push, _parent, _attrs, $props, $setup, $data, $options) {
at formatError (PATH\vue3-element-admin\node_modules\vite\dist\node\chunks\dep-0351185a.js:36769:46)
at TransformContext.error (PATH\vue3-element-admin\node_modules\vite\dist\node\chunks\dep-0351185a.js:36765:19)
at normalizeUrl (PATH\vue3-element-admin\node_modules\vite\dist\node\chunks\dep-0351185a.js:73694:26)
at async TransformContext.transform (PATH\vue3-element-admin\node_modules\vite\dist\node\chunks\dep-0351185a.js:73834:57)
at async Object.transform (PATH\vue3-element-admin\node_modules\vite\dist\node\chunks\dep-0351185a.js:36985:30)
at async doTransform (PATH\vue3-element-admin\node_modules\vite\dist\node\chunks\dep-0351185a.js:52057:29)
2条答案
按热度按时间55ooxyrt1#
谢谢pharyngical评论。
解决错误。
bq3bfh9z2#
尝试将“vite”和“@vitejs/plugin-vue”包更新到最新版本。