next.js icon indicating copy to clipboard operation
next.js copied to clipboard

shadcn components are not working with next 15

Open SARATHKUMAR-T opened this issue 1 year ago • 2 comments

Link to the code that reproduces this issue

https://github.com/SARATHKUMAR-T/next15

To Reproduce

  1. create new app with npx create-next-app@latest
  2. try to install shadcn ui with npx shadcn@latest init

Current vs. Expected behavior

Screenshot from 2024-10-25 16-04-05

Provide environment information

Operating System:
  Platform: linux
  Arch: x64
  Version: #47~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Wed Oct  2 16:16:55 UTC 2
  Available memory (MB): 11821
  Available CPU cores: 4
Binaries:
  Node: 20.13.1
  npm: 10.5.2
  Yarn: 1.22.22
  pnpm: N/A
Relevant Packages:
  next: 15.0.1 // Latest available version is detected (15.0.1).
  eslint-config-next: 15.0.1
  react: 19.0.0-rc-69d4b800-20241021
  react-dom: 19.0.0-rc-69d4b800-20241021
  typescript: 5.6.3
Next.js Config:
  output: N/A

Which area(s) are affected? (Select all that apply)

create-next-app, Developer Experience

Which stage(s) are affected? (Select all that apply)

next dev (local), next build (local), next start (local), Vercel (Deployed)

Additional context

No response

SARATHKUMAR-T avatar Oct 25 '24 10:10 SARATHKUMAR-T

This isn't NextJs issue seems like issue with radix-ui/react-icons library dependency list.

https://github.com/radix-ui/icons/pull/184#issuecomment-2436109770

can use the above link for temporary solution.

sanketssc avatar Oct 25 '24 11:10 sanketssc

As mentioned by @needim in this comment, the following override is a temporary workaround.

"overrides": {
	"@radix-ui/react-icons": {
		"react": "$react"
	}
}

gfargo avatar Oct 25 '24 13:10 gfargo

Link to the code that reproduces this issue

https://github.com/SARATHKUMAR-T/next15

To Reproduce

  1. create new app with npx create-next-app@latest
  2. try to install shadcn ui with npx shadcn@latest init

Current vs. Expected behavior

Screenshot from 2024-10-25 16-04-05

Provide environment information

Operating System:
  Platform: linux
  Arch: x64
  Version: #47~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Wed Oct  2 16:16:55 UTC 2
  Available memory (MB): 11821
  Available CPU cores: 4
Binaries:
  Node: 20.13.1
  npm: 10.5.2
  Yarn: 1.22.22
  pnpm: N/A
Relevant Packages:
  next: 15.0.1 // Latest available version is detected (15.0.1).
  eslint-config-next: 15.0.1
  react: 19.0.0-rc-69d4b800-20241021
  react-dom: 19.0.0-rc-69d4b800-20241021
  typescript: 5.6.3
Next.js Config:
  output: N/A

Which area(s) are affected? (Select all that apply)

create-next-app, Developer Experience

Which stage(s) are affected? (Select all that apply)

next dev (local), next build (local), next start (local), Vercel (Deployed)

Additional context

No response

its not really a bug, i install everything by hand, left out the @radix-ui/react-icons and use another icon provider like lucide or like @gfargo mentioned you can use the override but that will need more maintaining or is some deps break at runtime, so the secure way is use other icon provider until @radix-ui/react-icons update their lib.

hope it helps. ◦°˚(*❛‿❛)/˚°◦

masiafrest avatar Oct 31 '24 23:10 masiafrest