material-ui icon indicating copy to clipboard operation
material-ui copied to clipboard

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

Open danghieuliem opened this issue 10 months ago • 4 comments

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

danghieuliem avatar Apr 25 '24 04:04 danghieuliem

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

mj12albert avatar Apr 29 '24 13:04 mj12albert

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

danghieuliem avatar May 04 '24 02:05 danghieuliem

@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 };
}

pompep avatar May 06 '24 08:05 pompep

@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

danghieuliem avatar May 06 '24 10:05 danghieuliem

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

ZeeshanTamboli avatar May 17 '24 14:05 ZeeshanTamboli