Skip to content
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

[bug]: Sidebar Build Failed in NextJs Vercel Deployment #6008

Open
2 tasks done
Venkatesan-M opened this issue Dec 7, 2024 · 0 comments
Open
2 tasks done

[bug]: Sidebar Build Failed in NextJs Vercel Deployment #6008

Venkatesan-M opened this issue Dec 7, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@Venkatesan-M
Copy link

Venkatesan-M commented Dec 7, 2024

Describe the bug

When I tried to use ui/sidebar in the production code

Checking validity of types  ..Failed to compile.
./components/ui/sidebar.tsx:439:7
Type error: Type 'string | ((instance: HTMLDivElement | null) => void) | RefObject<HTMLDivElement> | null' is not assignable to type '((string | ((instance: HTMLDivElement | null) => void) | RefObject<HTMLDivElement>) & (((instance: HTMLElement | null) => void) | RefObject<...>)) | null | undefined'.
  Type 'string' is not assignable to type '((string | ((instance: HTMLDivElement | null) => void) | RefObject<HTMLDivElement>) & (((instance: HTMLElement | null) => void) | RefObject<...>)) | null | undefined'.
  437 |   return (
  438 |     <Comp
> 439 |       ref={ref}
      |       ^
  440 |       data-sidebar="group-label"
  441 |       className={cn(
  442 |         "duration-200 flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 outline-none ring-sidebar-ring transition-[margin,opa] ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0",
  

there is some type error. in the file sidebar.tsx

possible fix: changing ref={ref} to ref={ref as any} in the file ui/sidebar.tsx worked for me.

Affected component/components

ui/sidebar.tsx

How to reproduce

create a new nextjs + ts project. use the sidebar component and try

npm run build

Codesandbox/StackBlitz link

No response

Logs

No response

System Info

Minimum Requirements. (i5 10 gen, chrome browser)

Before submitting

  • I've made research efforts and searched the documentation
  • I've searched for existing issues
@Venkatesan-M Venkatesan-M added the bug Something isn't working label Dec 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant