[Bug]: Nuxt 4 dev server crashes when using shadcn-nuxt components with imported TypeScript types
Environment
- OS: Windows 11
- Nuxt:
4.5.1 - Vue:
3.5.40 shadcn-nuxt:2.8.0reka-ui:2.10.1- Vite:
8.1.5 - TypeScript:
7.0.2 - Node:
24.18.0 - Package manager: npm
Description
After adding shadcn-nuxt components, the project builds successfully, but the Nuxt dev server crashes when loading the application.
The error happens in components that use imported TypeScript types inside defineProps or interface extension.
Affected components:
components/ui/label/Label.vuecomponents/ui/button/Button.vuecomponents/ui/separator/Separator.vue
Steps to reproduce
- Create a Nuxt 4 project.
- Install
shadcn-nuxt. - Add components such as
label,button, orseparator. - Run:
npm run dev- Open the application in the browser.
Expected behavior
The Nuxt dev server should start normally and shadcn components should compile successfully.
Actual behavior
The dev server crashes with Vue compiler errors:
No fs option provided to compileScript in non-Node environment.
File system access is required for resolving imported types.Example:
const props = defineProps<LabelProps & { class?: HTMLAttributes["class"] }>()Stack trace:
at importSourceToScope
at resolveTypeFromImport
at resolveTypeReference
at innerResolveTypeElementsAnother related error:
[@vue/compiler-sfc] Failed to resolve extends base type.Example:
interface Props extends PrimitiveProps {Additional information
The project builds successfully, but fails during development server startup.
The issue appears only when components containing imported TypeScript types from shadcn/reka-ui are compiled.
I also noticed that some package install scripts were blocked during installation:
[email protected] (postinstall: node install.js)
[email protected] (postinstall: node install.js)
[email protected] (postinstall: ...)I am not sure if this is related, but mentioning it for completeness.
Workaround attempts
- Reinstalled dependencies
- Regenerated Nuxt files with:
npx nuxi prepare- Removed
.nuxtcache - Verified Vue and
@vue/compiler-sfcversions are matching:
Question
Is this a known compatibility issue between [email protected], [email protected], [email protected], and the current Vue compiler?
Is there a recommended version combination or configuration change to resolve this?
Source: unovue/shadcn-vue