mui / material-ui

Material UI: Ready-to-use foundational React components, free forever. It includes Material UI, which implements Google's Material Design.
https://mui.com/material-ui/
MIT License
91.86k stars 31.57k forks source link

[material-ui][TableRow] Exported variable 'StyledTableRow' has or is using name 'UNDEFINED_VOID_ONLY' #42020

Closed danghieuliem closed 1 day ago

danghieuliem commented 3 weeks ago

Steps to reproduce

Link to live example: (stackblitz)

./style.ts code

Screenshot 2024-04-25 at 11 13 47

Current behavior

No response

Expected behavior

No response

Context

No response

Your environment

npx @mui/envinfo ``` System: OS: macOS 14.4.1 Binaries: Node: 18.19.0 - ~/.nvm/versions/node/v18.19.0/bin/node npm: 10.2.3 - ~/.nvm/versions/node/v18.19.0/bin/npm pnpm: Not Found Browsers: Chrome: 124.0.6367.62 Edge: 124.0.2478.51 Safari: 17.4.1 npmPackages: @emotion/react: ^11.11.1 => 11.11.4 @emotion/styled: ^11.11.0 => 11.11.5 @mui/base: 5.0.0-beta.40 @mui/core-downloads-tracker: 5.15.15 @mui/icons-material: ^5.15.15 => 5.15.15 @mui/lab: ^5.0.0-alpha.154 => 5.0.0-alpha.170 @mui/material: ^5.15.15 => 5.15.15 @mui/private-theming: 5.15.14 @mui/styled-engine: 5.15.14 @mui/system: 5.15.15 @mui/types: 7.2.14 @mui/utils: 5.15.14 @mui/x-date-pickers: ^6.19.5 => 6.19.9 @types/react: ^18 => 18.2.79 react: ^18 => 18.2.0 react-dom: ^18 => 18.2.0 typescript: ^5.2.2 => 5.4.5 ```

Search keywords: TableRow, styled, UNDEFINED_VOID_ONLY, next export

mj12albert commented 2 weeks ago

@danghieuliem I can't reproduce this in your stackblitz - did you screenshot your error from there?

danghieuliem commented 2 weeks ago

Hi @mj12albert ! This error is from my local source code. It throws an error when I export static files in Next.js.

Screenshot 2024-05-04 at 09 16 26
pompep commented 1 week ago

@danghieuliem until DefinitelyTyped/DefinitelyTyped/pull/69341 is not merged, react type redeclaration may help you

declare const UNDEFINED_VOID_ONLY: unique symbol;
declare module "react" {
   export type VoidOrUndefinedOnly = void | { [UNDEFINED_VOID_ONLY]: never };
}
danghieuliem commented 1 week ago

@danghieuliem until DefinitelyTyped/DefinitelyTyped/pull/69341 is not merged, react type redeclaration may help you

declare const UNDEFINED_VOID_ONLY: unique symbol;
declare module "react" {
   export type VoidOrUndefinedOnly = void | { [UNDEFINED_VOID_ONLY]: never };
}

It work for me. Thank you! @pompep

ZeeshanTamboli commented 1 day ago

@danghieuliem I'll close this issue then. Doesn't look related to MUI.