ui icon indicating copy to clipboard operation
ui copied to clipboard

Using the button component with asChild prop with

Open LefterisIkaria opened this issue 2 years ago • 6 comments

LefterisIkaria avatar Nov 19 '23 20:11 LefterisIkaria

hey, can you please elaborate more about this issue ?

devender15 avatar Nov 25 '23 14:11 devender15

I'm getting what's likely a similar error: 2023-12-04_17-20-50

Type '{ disabled?: boolean | undefined; form?: string | undefined; formAction?: string | ((formData: FormData) => void) | undefined; formEncType?: string | undefined; formMethod?: string | undefined; ... 272 more ...; ref: ForwardedRef<...>; }' is not assignable to type 'SlotProps'. Types of property 'children' are incompatible. Type 'React.ReactNode' is not assignable to type 'import("/Users/ryanhunter/projects/causal-flow-ts/causal-flow/node_modules/.pnpm/@[email protected]/node_modules/@types/react/index").ReactNode'. Type 'ReactElement<any, string | JSXElementConstructor<any>>' is not assignable to type 'ReactNode'. Property 'children' is missing in type 'ReactElement<any, string | JSXElementConstructor<any>>' but required in type 'ReactPortal'.

seemed to have happened after I did pnpm install, while primarily using bun install.

I deleted node modules and did bun install again and it fixed.

artimath avatar Dec 05 '23 03:12 artimath

I almost created an issue in radix-ui/primitives, but I solved the problem. It is just a resolution mismatch issue when you update one package when another package with peerDependencies isn't updated yet. It's the problem of the package manager.

Happy news, welcome 2024, and @shadcn you can close each similar issue with this.

The solution for this particular problem is always the same, due to the package manager resolution problem, here's the steps:

  1. delete node_modules
  2. delete lockfile (in my case it's bun.lockb)
  3. install (in my case bun i or bun install)
  4. run tsc to make sure (in my case bunx tsc)

Works like a charm.

ImBIOS avatar Jan 02 '24 02:01 ImBIOS

If you're still having issues, I had to manually make sure my "resolutions" field was matching my types/react version in my "devDependencies":

"resolutions": {
    "@types/react": "18.2.8"
  },

dragonkhoi avatar Jan 16 '24 20:01 dragonkhoi

thanks @dragonkhoi

dzakyabdurhmn avatar Jan 20 '24 00:01 dzakyabdurhmn

I'm having the same issue still with latest versions of the dependent libraries. But only when I deploy to Vercel. At first locally I just had a @ts-ignore to get through the issue, but when I pushed to Vercel it threw an error about the ts-ignore being unneeded/unused, when I follow steps above it then started throwing the error in Vercel, but not locally. :\

bright-and-early avatar Feb 06 '24 05:02 bright-and-early

This issue has been automatically closed because it received no activity for a while. If you think it was closed by accident, please leave a comment. Thank you.

shadcn avatar Feb 29 '24 23:02 shadcn

I almost created an issue in radix-ui/primitives, but I solved the problem. It is just a resolution mismatch issue when you update one package when another package with peerDependencies isn't updated yet. It's the problem of the package manager.

Happy news, welcome 2024, and @shadcn you can close each similar issue with this.

The solution for this particular problem is always the same, due to the package manager resolution problem, here's the steps:

  1. delete node_modules
  2. delete lockfile (in my case it's bun.lockb)
  3. install (in my case bun i or bun install)
  4. run tsc to make sure (in my case bunx tsc)

Works like a charm.

Yeah, it's working for me. Thanks.

namnguyenthanhwork avatar Mar 23 '24 16:03 namnguyenthanhwork