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

TypeScript error in SinglePickerPanelProps interface during build process #764

Open
chaiwei opened this issue Feb 23, 2024 · 4 comments
Open

Comments

@chaiwei
Copy link

chaiwei commented Feb 23, 2024

Reproduction link

Edit SinglePickerPanelProps

Steps to Reproduce:

  • Open the reproduction link in CodeSandbox
  • Navigate to the build terminal
  • Trigger the build process
  • Observe the TypeScript error encountered during the build process.

What is Expected?

The build process should complete successfully without encountering any TypeScript errors.

What is Actually Happening?

During the build process, the TypeScript error TS2430 occurs in the file node_modules/rc-picker/lib/PickerPanel/index.d.ts.

node_modules/rc-picker/lib/PickerPanel/index.d.ts:40:18 - error TS2430: Interface 'SinglePickerPanelProps<DateType>' incorrectly extends interface 'BasePickerPanelProps<DateType>'.
  Types of property 'defaultValue' are incompatible.
    Type 'DateType | null | undefined' is not assignable to type 'DateType | undefined'.
      Type 'null' is not assignable to type 'DateType | undefined'.

40 export interface SinglePickerPanelProps<DateType extends object = any> extends BasePickerPanelProps<DateType> {
                    ~~~~~~~~~~~~~~~~~~~~~~

Found 1 error in node_modules/rc-picker/lib/PickerPanel/index.d.ts:40

Additional Comments:

Dependency Version
antd 5.14.1
dayjs 1.11.10
react ^18.2.0
react-dom ^18.2.0
@RickieWoo
Copy link

any solution?

@chaiwei
Copy link
Author

chaiwei commented Mar 15, 2024

You can ignore the error by adding "skipLibCheck": true to your compilerOptions in your tsconfig.json file.

"compilerOptions": {
    // ... the remaining options
    "skipLibCheck": true,
}

This will skip type checking of declaration files, which might resolve the TypeScript error you're encountering.

@authc0d3
Copy link

Any progress with this?

@ejsinfuego
Copy link

ejsinfuego commented May 26, 2024

I also come across this issue

@chaiwei already submit a pull request #765 . Thank you.

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

No branches or pull requests

4 participants