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]: Type error: Property 'char' does not exist on type 'SlotProps | undefined'. #3585
Comments
this will fix it.
|
I have the following error with this solution: Use a ! assertion to more succinctly remove null and undefined from the type.eslint@typescript-eslint/non-nullable-type-assertion-style |
hey @ritmillio input-otp maintainer here 👋🏻 could not reproduce it locally. can you provide a stackblitz? |
Ran into the same issue today, fresh install from shadcn. |
I reinstalled my project with PNPM instead of Bun, problem solved. |
Hey, @guilhermerodz Here's a minimum reproduction of my use-case: https://stackblitz.com/edit/stackblitz-starters-9avgfk?file=src%2Fcomponents%2Fui%2Finput-otp.tsx @keeandev - I am using pnpm but reinstalling didn't solve my problem |
Apologies, I had a very similar issue, but I solved this issue by putting an exclamation mark at the end of the line. |
Describe the bug
After installation of the input-otp component I am getting a build error in Next.js - using TypeScript.
The error occurs here:
const { char, hasFakeCaret, isActive } = inputOTPContext.slots[index];
Property 'char' does not exist on type 'SlotProps | undefined'.ts(2339)
Property 'hasFakeCaret' does not exist on type 'SlotProps | undefined'.ts(2339)
Property 'isActive' does not exist on type 'SlotProps | undefined'.ts(2339)
Affected component/components
Input OTP
How to reproduce
Install input-otp.
Setup eslint:
eslintrc.cjs:
Codesandbox/StackBlitz link
No response
Logs
System Info
Before submitting
The text was updated successfully, but these errors were encountered: