Closed Kutius closed 4 days ago
Do you have a minimal reproduction that I can dig into?
What was your Vite config, VitePress config and theme config?
@nekomeowww Maybe I found the key
This is Vite config:
vite: {
plugins: [
Unocss(),
GitChangelog({
// 填写在此处填写您的仓库链接
repoURL: () => 'https://xxx.com/knowledge/wiki/tree/@next-vitepress',
getCommitURL: commit => `${commit.repo_url?.replace('/tree/@next-vitepress', '')}/commit/${commit.hash}`,
}),
GitChangelogMarkdownSection(),
],
optimizeDeps: {
exclude: [
'@nolebase/vitepress-plugin-enhanced-readabilities/client',
],
},
ssr: {
noExternal: [
// 如果还有别的依赖需要添加的话,并排填写和配置到这里即可
'@nolebase/vitepress-plugin-enhanced-readabilities',
],
},
},
When I replace the value in ssr noEXternal
'@nolebase/vitepress-plugin-enhanced-readabilities'
to
'@nolebase/*'
And then get no error
Just chiming in here, doing the solution mentioned above works.
Original error:
vitepress v1.3.0
✓ building client + server bundles...
build error:
Unknown file extension ".vue" for E:\Users\cake\Desktop\Test\node_modules\@nolebase\vitepress-plugin-inline-link-preview\dist\client\components\PopupIframe.vue
TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".vue" for E:\Users\cake\Desktop\Test\node_modules\@nolebase\vitepress-plugin-inline-link-preview\dist\client\components\PopupIframe.vue
at Object.getFileProtocolModuleFormat [as file:] (node:internal/modules/esm/get_format:160:9)
at defaultGetFormat (node:internal/modules/esm/get_format:203:36)
at defaultLoad (node:internal/modules/esm/load:143:22)
at async ModuleLoader.load (node:internal/modules/esm/loader:396:7)
at async ModuleLoader.moduleProvider (node:internal/modules/esm/loader:278:45)
Was the error given
However using this config:
vite: {
optimizeDeps: {
exclude: [
'@nolebase/vitepress-plugin-inline-link-preview/markdown-it',
],
},
ssr: {
noExternal: [
'@nolebase/*',
],
},
},
has made it work.
I originally had either no config placed (testing purposes) or with @nolebase/vitepress-plugin-inline-link-preview/markdown-it
placed in the ssr caused the error.
Sorry for the delay, I was in Hackathon last week and we had no time to focus on Nolebase communities. Apologize for the delay, really!
Please, much appriciated if any of you would like to take a look into this, a documentation contribution to mention this out is welcome too!
Possibly related to https://github.com/nolebase/nolebase/issues/59
Adding @nolebase/vitepress-plugin-inline-link-preview
into ssr. noExternal
would solve this.
config:
output:
It looks like an SSG configuration error.