Closed
Description
Here's the simplest way to repro it:
- Add a custom theme (take
vuepress-theme-vue
for example) to a new repo:
mkdir testrepo
cd testrepo
yarn add vuepress-theme-vue
- Create
src
and base files, then the directory will be like this:
+-- src/
| +-- .vuepress/
| +-- config.js
| +-- README.md
+-- node_modules
| +-- vuepress-theme-vue/
+-- package.json
+-- yarn.lock
- Set theme to
vue
inconfig.js
module.exports = {
theme: 'vue'
}
- Run global
vuepress
vuepress dev src
- Error
Error: [vuepress] Failed to load custom theme "vue". File vuepress-theme-vue/Layout.vue does not exist.
- Possible solutions
- Install custom theme globally (i.e.
yarn global add vuepress-theme-vue
) - (Or) Install
vuepress
locally (i.e.yarn add vuepress
) and run it locally (i.e.yarn vuepress dev src
)
The cause is that we are using require.resolve()
to resolve custom theme:
Lines 139 to 140 in 145cf4f
Is there a better solution?
Metadata
Metadata
Assignees
Labels
No labels