Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: fix build issue in vite config #316

Merged
merged 1 commit into from
Oct 9, 2024
Merged

Conversation

Alice39s
Copy link
Contributor

@Alice39s Alice39s commented Oct 6, 2024

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
0 of 2 checks passed
@nekomeowww
Copy link
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