[bug] console shows: [vite] Internal server error: Failed to resolve import "@theme/Home.vue" from "node_modules\@vuepress\theme-default\lib\client\layouts\Layout.vue". Does the file exist? #1461
Replies: 1 comment 2 replies
-
|
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
Mister-Hope
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
English
context:
this is the package.json.
description:
I used the
npm run dev
command, and there was nothing wrong at first, but when I clicked on the link at the bottom of the console, when I opened the page, the page would show:Since version 2.0.0-beta.51 (2022-08-28) no longer supports putting layouts into theme data structures, I configured the following code here when loading layouts:
the file tree is:
By the way, the file 'Navigation.vue' is the Layout that is only used on the home page.
Finally
I'm sorry that my English is not very good, and vue is not very good at learning.
thank you for your guidance
PS
The
vuepress info
command didn't detect the Chrome I was using, so I wrote the version number by myself.中文
使用@vuepress 2.0.0-rc.0的时候会导致@vuepress/theme-default下面的文件
@theme
无法解析以及无法找到,并且还有一点非常奇怪,虽然是vite构建的,却没有vite.config.ts
文件。虽然会报错:Failed to resolve import "@theme/Home.vue" from "node_modules\@vuepress\theme-default\lib\client\layouts\Layout.vue". Does the file exist?
但本质上文件时存在的。感谢各位大佬帮忙答疑解惑。
Beta Was this translation helpful? Give feedback.
All reactions