-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
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 broken in latest release ElementType
requires between 0-1 type arguments
#40427
Comments
We're seeing the same issue, and have pinned to @mui/material: "5.15.2" and "@mui/base": "5.0.0-beta.28" as a workaround. Order ID 72484 `npx @mui/envinfo```` System: OS: macOS 14.2.1 Binaries: Node: 18.15.0 - ~/.nvm/versions/node/v18.15.0/bin/node Yarn: 1.22.21 - ~/.nvm/versions/node/v18.15.0/bin/yarn npm: 9.5.0 - ~/.nvm/versions/node/v18.15.0/bin/npm Browsers: Chrome: 120.0.6099.199 Edge: 120.0.2210.91 Safari: 17.2.1 npmPackages: @emotion/react: 11.11.1 @emotion/styled: 11.11.0 @mui/base: 5.0.0-beta.30 @mui/core-downloads-tracker: 5.15.3 @mui/lab: 5.0.0-alpha.159 @mui/material: 5.15.3 @mui/private-theming: 5.15.3 @mui/styled-engine: 5.15.3 @mui/system: 5.15.3 @mui/types: 7.2.12 @mui/utils: 5.15.3 @mui/x-charts: 6.18.3 @mui/x-data-grid: 6.18.6 @mui/x-data-grid-pro: 6.18.6 @mui/x-date-pickers: 6.18.6 @mui/x-date-pickers-pro: 6.18.6 @mui/x-license-pro: 6.10.2 @types/react: 18.2.42 => 18.2.42 react: ^18.2.0 => 18.2.0 react-dom: ^18.2.0 => 18.2.0 typescript: 5.2.2 => 5.2.2 ``` |
Same here |
- Temporarily locked down "@mui/material": "5.15.2" and "@mui/base": "5.0.0-beta.28" due to mui/material-ui#40427
i have the same problem |
Same problem here. |
* Fix: Bumped packages using `npm run bump-all-packages` - Temporarily locked down "@mui/material": "5.15.2" and "@mui/base": "5.0.0-beta.28" due to mui/material-ui#40427 * - Responded to reviewer feedback by removing an added dev-dependency that seems unnecessary
I temporarily bypassed the error by changing
In your MUI package, go to the following files :
and update the declarations in both files I think the root cause is related to this PR on |
I fixex it updating the typescript.
…On Wed, Jan 10, 2024, 18:29 Mohamed Chedli Ben Yaghlane < ***@***.***> wrote:
I temporarily bypassed the error by changing <React.ElementType<any,
keyof React.JSX.IntrinsicElements> with React.ElementType<any> in Popper
and Popup declarations.
React.ElementType is being given two arguments: any and keyof
React.JSX.IntrinsicElements. However, React.ElementType is designed to take
only one argument or none at all.
In your MUI package, go to the following files :
-
***@***.***/material/Popper/Popper.d.ts
-
***@***.***/base/Unstable_Popup/Popup.d.ts
and update the declarations in both files
This may be related to this PR on @Types/react :
DefinitelyTyped/DefinitelyTyped#67430
<DefinitelyTyped/DefinitelyTyped#67430>
—
Reply to this email directly, view it on GitHub
<#40427 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AKH6DEMKPD76KBPY2D67GCTYN3FWXAVCNFSM6AAAAABBMWXM2CVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOBVGI4TIOBQHE>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
@jonystn could you please specify from which version to which version did you update? thanks! |
@raphaelbp12 |
As of the current version However we also changed the package manager to |
This seems to work around mui/material-ui#40427; `yarn tsc:full` no longer fails in a freshly-scaffolded test app. Signed-off-by: Jamie Klassen <[email protected]>
Same problem here. Workaround not working. I get this error after enabled techdoc mermaid addon. Version 1.21.1 and version 1.22.1 |
Also with the same issue! |
Likewise. |
Hi, some information regarding this topic? |
Any updates on this issue? Running |
Hi, not being able to find a solution. Is there any idea how to solve this? |
I solved this issue by putting specific versions on our resolutions in "resolutions": {
"@mui/material": "5.15.2",
"@mui/base": "5.0.0-beta.28",
}, |
@raphaelbp12 This worked for me as a temporary fix. Hopefully mui will resolve the issue soon. |
The workaround targeting older versions of |
This comment was marked as outdated.
This comment was marked as outdated.
Update: Downgrading |
This issue happens to start at - type ElementType<P = any> =
+ type ElementType<P = any, Tag extends keyof JSX.IntrinsicElements = keyof JSX.IntrinsicElements> = I wonder why our build process replaces the use of declared See the implementation: type PopperProps = Omit<BasePopperProps, 'direction'> & {
/**
* The component used for the root node.
* Either a string to use a HTML element or a component.
*/
component?: React.ElementType;
/**
* The components used for each slot inside the Popper.
* Either a string to use a HTML element or a component.
* @default {}
*/
components?: {
Root?: React.ElementType;
};
/**
* The props used for each slot inside the Popper.
* @default {}
*/
componentsProps?: BasePopperProps['slotProps'];
/**
* The system prop that allows defining system overrides as well as additional CSS styles.
*/
sx?: SxProps<Theme>;
};
const Popper = React.forwardRef() as React.ForwardRefExoticComponent<PopperProps & React.RefAttributes<HTMLDivElement>>; Here is the build result: declare const Popper: React.ForwardRefExoticComponent<Omit<BasePopperProps, "direction"> &
// the object below should just be PopperProps
{
/**
* The component used for the root node.
* Either a string to use a HTML element or a component.
*/
component?: React.ElementType<any, keyof React.JSX.IntrinsicElements> | undefined;
/**
* The components used for each slot inside the Popper.
* Either a string to use a HTML element or a component.
* @default {}
*/
components?: {
Root?: React.ElementType<any, keyof React.JSX.IntrinsicElements> | undefined;
} | undefined;
/**
* The props used for each slot inside the Popper.
* @default {}
*/
componentsProps?: BasePopperProps['slotProps'];
/**
* The system prop that allows defining system overrides as well as additional CSS styles.
*/
sx?: SxProps<Theme> | undefined;
} & React.RefAttributes<HTMLDivElement>>; |
I wouldn't pay too close attention to that. I've been experiencing this with @types/react 17.0.65 |
It's related. Because we built with the latest This will fix the issue including future proof if the build process does not use the generic. In meanwhile, how about reverting the #40146 back to cc @mui/code-infra |
We are blocked on this for future updates. |
@benjdlambert @antoniocanelas Can you try this fix? // package.json
"@mui/material": "https://pkg.csb.dev/mui/material-ui/commit/738da163/@mui/material",
… |
This solution didn't fix. :( |
Did you tested the version shared in #40427 (comment)? |
Steps to reproduce
yarn install && yarn tsc --skipLibCheck=false
Current behavior
Expected behavior
No typescript errors
Context
looks like this error started from the release yesterday.
Your environment
npx @mui/envinfo
Search keywords: Typescript tsc GenericType
The text was updated successfully, but these errors were encountered: