-
Notifications
You must be signed in to change notification settings - Fork 48
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
Wrong import when adding component. - Shadcn Plugin #352
Comments
Those are based off what is defined inside the |
Hi, Thanks for the reply! Here is my components.json file. {
"$schema": "https://ui.shadcn.com/schema.json",
"style": "default",
"rsc": false,
"tailwind": {
"config": "libs\\shadcn-ui-utils\\src\\tailwind.config.ts",
"css": "libs\\shadcn-ui-utils\\src\\global.css",
"baseColor": "neutral",
"cssVariables": true
},
"aliases": {
"ui": "@myproject-mono/shadcn-ui",
"components": "@myproject-mono/shadcn-ui/components",
"utils": "@myproject-mono/shadcn-ui-utils",
"hooks": "@myproject-mono/shadcn-ui/hooks"
}
}
|
That looks good, the |
All looks to be correctly configured on my end. tsconfig.base.json {
"compileOnSave": false,
"compilerOptions": {
"rootDir": ".",
"sourceMap": true,
"declaration": false,
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"strictPropertyInitialization": false,
"importHelpers": true,
"target": "es2015",
"module": "esnext",
"lib": [
"es2020",
"dom"
],
"skipLibCheck": true,
"skipDefaultLibCheck": true,
"baseUrl": ".",
"paths": {
"@myproject-mono/common": [
"libs/common/src/index.ts"
],
"@myproject-mono/common/api": [
"libs/common/src/lib/api/index.ts"
],
"@myproject-mono/common/entities": [
"libs/common/src/lib/entities/index.ts"
],
"@myproject-mono/common/modules": [
"libs/common/src/lib/modules/index.ts"
],
"@myproject-mono/common/services": [
"libs/common/src/lib/services/index.ts"
],
"@myproject-mono/shadcn-ui": [
"libs/shadcn-ui/src"
],
"@myproject-mono/shadcn-ui-utils": [
"libs/shadcn-ui-utils/src"
],
"@myproject-mono/shadcn-ui/*": [
"libs/shadcn-ui/src/*"
],
"@myproject-mono/shadcn-ui-utils/*": [
"libs/shadcn-ui-utils/src/*"
]
}
},
"exclude": [
"node_modules",
"tmp"
]
} |
I have the exact same problem. Tried on a fresh install. It always imports from Even when I change the aliases in |
When running the command
nx add-component shadcn-ui button
, no errors are displayed; however, the generated import for thecn
function in the component is incorrect.Generated
Button.tsx
:Expected Import:
Note: The library names provided during plugin usage were
shadcn-ui
andshadcn-ui-utils
.The text was updated successfully, but these errors were encountered: