Skip to content

docs: fix build issue in vite config - #316

Merged
nekomeowww merged 1 commit into
nolebase:mainfrom
Alice39s:main
Oct 9, 2024
Merged

docs: fix build issue in vite config#316
nekomeowww merged 1 commit into
nolebase:mainfrom
Alice39s:main

Conversation

@Alice39s

@Alice39s Alice39s commented Oct 6, 2024

Copy link
Copy Markdown
Contributor

Updated Vite configuration to properly handle .vue files from @nolebase/ui. Fixed "Unknown file extension '.vue'" error during Vitepress build process.

Add the following line to the optimizeDeps.exclude / ssr.noExternal section in the Vite config:

'@nolebase/ui'.

The build error example:

build error:
Unknown file extension ".vue" for /vercel/path0/node_modules/@nolebase/ui/dist/components/NuTag/index.vue
TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".vue" for /vercel/path0/node_modules/@nolebase/ui/dist/components/NuTag/index.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:553:7)
    at async ModuleLoader.moduleProvider (node:internal/modules/esm/loader:434:45)
error: script "build" exited with code 1
Error: Command "npm run build" exited with 1

Updated Vite configuration to properly handle .vue files from @nolebase/ui.
Resolves "Unknown file extension '.vue'" error during Vitepress build process.
@nekomeowww
nekomeowww merged commit b04dabe into nolebase:main Oct 9, 2024
@nekomeowww

Copy link
Copy Markdown
Member

Thanks, merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants