-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Open
Labels
Description
Describe the bug
When creating a custom theme following the docs, and then installing it in another VitePress page, it throws an error at docs:build (working fine on docs:dev:
Cannot find module '/home/silvester/Desktop/temp3/page/node_modules/vitepress/dist/client/theme-default/without-fonts' imported from /home/silvester/Desktop/temp3/page/node_modules/vitepress/dist/client/theme-default/index.js
Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/home/silvester/Desktop/temp3/page/node_modules/vitepress/dist/client/theme-default/without-fonts' imported from /home/silvester/Desktop/temp3/page/node_modules/vitepress/dist/client/theme-default/index.js
at finalizeResolution (node:internal/modules/esm/resolve:265:11)
at moduleResolve (node:internal/modules/esm/resolve:933:10)
at defaultResolve (node:internal/modules/esm/resolve:1169:11)
at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:542:12)
at ModuleLoader.resolve (node:internal/modules/esm/loader:510:25)
at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:239:38)
at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:96:40)
at link (node:internal/modules/esm/module_job:95:36)
import MyTheme from 'my-theme';
export default {
extends: MyTheme,
}Reproduction
Reproduction repository: https://github.com/silvester-pari/vitepress-custom-theme-error
(Follow instructions in Readme)
Expected behavior
When extending a Theme based on the DefaultTheme, it should work.
System Info
System:
OS: Linux 6.8 Linux Mint 22 (Wilma)
CPU: (8) x64 Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz
Memory: 5.49 GB / 15.39 GB
Container: Yes
Shell: 5.2.21 - /bin/bash
Binaries:
Node: 20.18.1 - ~/.nvm/versions/node/v20.18.1/bin/node
npm: 10.8.2 - ~/.nvm/versions/node/v20.18.1/bin/npm
Browsers:
Chrome: 131.0.6778.204
Additional context
No response
Validations
- Check if you're on the latest VitePress version.
- Follow our Code of Conduct
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.