Skip to content
New issue

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

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

Already on GitHub? # to your account

[bug] :Error: Cannot read properties of undefined (reading 'resolvedPaths') #6527

Open
shadcn opened this issue Jan 31, 2025 · 17 comments
Open

Comments

@shadcn
Copy link
Collaborator

shadcn commented Jan 31, 2025

If you're seeing the error message, make sure you have aliases defined for components, utils, ui, lib and hooks in your components.json.

"aliases": {
  "components": "@/components",
  "utils": "@/lib/utils",
  "ui": "@/components/ui",
  "lib": "@/lib",
  "hooks": "@/hooks"
}

Thanks @MatiasSommer for helping me debug this.

@shadcn shadcn pinned this issue Jan 31, 2025
@Yonom
Copy link

Yonom commented Feb 1, 2025

(I am hosting my own shadcn registry) A lot of my users are asking me about this. Would it be possible for shadcn CLI to add the missing aliases automatically if they're missing?

@SantaRoger
Copy link

This worked for me when i encountered this error in the past day or so.
I was missing ui and hooks in mine. I added them and it seemed to install the component right.

@maxmaio
Copy link

maxmaio commented Feb 4, 2025

This worked for me too - is there a place change was announced?

@joshdance
Copy link

Found this thread from this post - #6509

Adding the 3 missing aliases fixed it for me. I was unaware a change was made that would require them. Glad to find the fix.

@shaniCoder21
Copy link

Today, I faced this error. When I checked the ShadCN GitHub repository, I found the solution. The issue occurred because I missed adding ui, lib, and hook in the components.json file. After adding them, the problem was resolved.

@mujibulhaquetanim
Copy link

Thanks that worked but can someone explain why the error happened in the first place, previously, we didn't have to do this.

@onlyoneaman
Copy link

Works now, after wasting so much time cleaning and reinstalling packages unsure about the issue.

@deveduar
Copy link

deveduar commented Feb 6, 2025

adding "components": "@/components" in aliases, worked for me, thankss

ash0545 added a commit to ash0545/tournament-software that referenced this issue Feb 7, 2025
- Add shadcn/ui's Badge component
- Add basic styling to tournament header
- Fix aliasing issue with shadcn/ui 2.3.0 (shadcn-ui/ui#6527)
@arshkboss
Copy link

i wasted so much time, finally fixed it. Thanks.

Jeromestein added a commit to MeiyuTech/AET-App that referenced this issue Feb 8, 2025
rexdotsh added a commit to heurist-network/imagine that referenced this issue Feb 9, 2025
@erickweyunga
Copy link

me too worked, thanks so much

@govindpvenu
Copy link

Thank you it worked.

@cristiana214
Copy link

If you're seeing the error message, make sure you have aliases defined for components, utils, ui, lib and hooks in your components.json.

"aliases": {
  "components": "@/components",
  "utils": "@/lib/utils",
  "ui": "@/components/ui",
  "lib": "@/lib",
  "hooks": "@/hooks"
}

Thanks @MatiasSommer for helping me debug this.

thank you, it works!

@NinjaLukeI
Copy link

works

@heanfig
Copy link

heanfig commented Feb 14, 2025

Works for me in components.json

"aliases": {
  "components": "@/components",
  "utils": "@/lib/utils",
  "ui": "@/components/ui",
  "lib": "@/lib",
  "hooks": "@/hooks"
}

@amjido-01
Copy link

If you're seeing the error message, make sure you have aliases defined for components, utils, ui, lib and hooks in your components.json.

"aliases": {
  "components": "@/components",
  "utils": "@/lib/utils",
  "ui": "@/components/ui",
  "lib": "@/lib",
  "hooks": "@/hooks"
}

Thanks @MatiasSommer for helping me debug this.

this works for me also

@JakeWayne07
Copy link

Thanks a lot. It works flawlessly.

@shadcn
Copy link
Collaborator Author

shadcn commented Feb 21, 2025

Fixed in new canary: npx shadcn@canary. Will tag stable soon.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests