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

[pickers] Cannot compile in TypeScript with skipLibCheck: false in MUI 7.20.0 #14924

Closed
jcrang opened this issue Oct 11, 2024 · 6 comments · Fixed by #14925
Closed

[pickers] Cannot compile in TypeScript with skipLibCheck: false in MUI 7.20.0 #14924

jcrang opened this issue Oct 11, 2024 · 6 comments · Fixed by #14925
Assignees
Labels
component: pickers This is the name of the generic UI component, not the React module! regression A bug, but worse

Comments

@jcrang
Copy link

jcrang commented Oct 11, 2024

Note: this is the same issue as #14895; I believe that fixed the issue in DateRangePicker.d.ts but not DateRangePickerToolbar.d.ts

Steps to reproduce

Link to live example: (required)

https://stackblitz.com/edit/react-jf96wz?file=Demo.tsx,index.tsx,node_modules%2F%40mui%2Fx-date-pickers-pro%2FDateRangePicker%2FDateRangePickerToolbar.d.ts

Steps:

  1. Open DateRangePickerToolbar.d.ts

Make sure to have skipLibCheck set to false in tsconfig.json.

Current behavior

TypeScript compiler errors shown under import("luxon") and import("moment")

image

Expected behavior

No TypeScript compiler errors

Context

No response

Your environment

npx @mui/envinfo
  Don't forget to mention which browser you used.
  Output from `npx @mui/envinfo` goes here.

Search keywords: skipLibCheck luxon moment pickers

@jcrang jcrang added bug 🐛 Something doesn't work status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Oct 11, 2024
@jcrang
Copy link
Author

jcrang commented Oct 11, 2024

There was some discussion in #14896 on how to catch this issue earlier.

A possible solution would be to create an empty project with MUI-X and compile it with skipLibCheck: false. Is this something that would be possible in your current build infrastructure?

@flaviendelangle flaviendelangle self-assigned this Oct 11, 2024
@flaviendelangle
Copy link
Member

Damn... I missed this one 🙄

I fixed it in DateTimeRangePickerToolbar
We definitely need to invest some time adding a check to the CI somehow

Opening a PR 😬

@LukasTy
Copy link
Member

LukasTy commented Oct 11, 2024

How come this is a problem? 🤔
We have specifically fixed it only in the DateTimeRangePickerToolbar. 🙈
I've tested multiple times by building locally. 🤷


Could there have been a problem with the release?
Have we tried local build?

@flaviendelangle flaviendelangle added regression A bug, but worse component: pickers This is the name of the generic UI component, not the React module! and removed bug 🐛 Something doesn't work status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Oct 11, 2024
@flaviendelangle
Copy link
Member

I tried the Codesandbox build
But for me it only causes problem if you import the component, so if you only had import {...} from '@mui/x-date-pickers-pro/DateTimeRangePicker' then the DateRangePickerToolbar toolbar is never used and causes no problem to TS :/

I used the search of the IDE to check if I had other instances of import() but I guess I did something wrong..
I searched for it again and I can't find another other instances...

@LukasTy
Copy link
Member

LukasTy commented Oct 11, 2024

Nevermind. It's late Friday and I'm sick. 😆
It's the difference of DateTimeRangePickerToolbar and DateRangePickerToolbar. 🤦

Copy link

This issue has been closed. If you have a similar problem but not exactly the same, please open a new issue.
Now, if you have additional information related to this issue or things that could help future readers, feel free to leave a comment.

Note

@jcrang How did we do? Your experience with our support team matters to us. If you have a moment, please share your thoughts in this short Support Satisfaction survey.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: pickers This is the name of the generic UI component, not the React module! regression A bug, but worse
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants