question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

React builder breaks with MUI Popper typings

See original GitHub issue

Current Behavior

I can only replicate this with nx builder.

Error during bundle: Error: my-component.tsx(72,8): semantic error TS2740: Type '{ children: (props: any) => Element; open: boolean;
anchorEl: HTMLButtonElement | null; transition: true; placement: string; }' is missing the following properties from type
'Pick<PopperProps, "open" | "className" | "style" | "slot" | "title" | "defaultChecked" | "defaultValue" |
"suppressContentEditableWarning" | "suppressHydrationWarning" | ... 254 more ... | "popperRef">':
className, style, slot, title, and 255 more.

Storybook can serve it but when you run nx build:myReactLibrary then you get the error above

Expected Behavior

That it builds without errors - just like the nx storybook plugin does

Steps to Reproduce

TS Playground, VSCode typescript server (IDE intellisense) and Storybook all compile the example correctly - only nx run my-lib:build does it fails with the error above.

https://www.typescriptlang.org/play?#code/JYWwDg9gTgLgBAKjgQwM5wEoFNkGN4BmUEIcA5FDvmQNwBQokscA3nAAoRhhZRwC+cIiXIABEAFdgAehDIYvYMgA2tBuGjwWdOHGnS4MABZY4uEpAB2WSzHQBPCBLgTUWACZ1Bw0mXHzFFQBaKWlzSjI6OgIJS3xgCEs4ABEsEAgACgBKVh04ShgJKCSMvN0AHk5uXjguGwBeFhgoCSx+AD5y6SqeKHa8rK8gA

Failure Logs

Environment

  Node : 16.13.1
  OS   : win32 x64
  pnpm : 6.23.6

  nx : 13.3.1
  @nrwl/angular : undefined
  @nrwl/cli : 13.3.1
  @nrwl/cypress : 13.3.1
  @nrwl/devkit : 13.3.1
  @nrwl/eslint-plugin-nx : 13.3.1
  @nrwl/express : undefined
  @nrwl/jest : 13.3.1
  @nrwl/linter : 13.3.1
  @nrwl/nest : 13.3.1
  @nrwl/next : undefined
  @nrwl/node : 13.3.1
  @nrwl/nx-cloud : 13.0.0
  @nrwl/react : 13.3.1
  @nrwl/react-native : undefined
  @nrwl/schematics : undefined
  @nrwl/tao : 13.3.1
  @nrwl/web : 13.3.1
  @nrwl/workspace : 13.3.1
  @nrwl/storybook : 13.3.1
  @nrwl/gatsby : undefined
  typescript : 4.4.4
  rxjs : 7.4.0
  ---------------------------------------
  Community plugins:
         @jscutlery/semver: 2.15.0
         @jscutlery/semver: 2.15.0
         @nrwl/js: 13.3.1
         @trumbitta/nx-plugin-openapi: 1.10.0

(node:21680) [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./" in the "exports" field module resolution of the package at myProject\node_modules\tslib\package.json.
Update this package.json to use a subpath pattern like "./*".
(Use `node --trace-deprecation ...` to show where the warning was created)

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:1
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

5reactions
awaisg717commented, Nov 30, 2022

I have to change the latest “@types/react”.

1reaction
Cheewbaccacommented, Dec 6, 2022

@smasala The solution for me was to add params onResize and onResizeCapture, which are missing in mui interface for some reason image

Read more comments on GitHub >

github_iconTop Results From Across the Web

MUI Popper: Placement not working as intended when using ...
I have a Box and upon clicking it, I open a popper that has some inputs. I am using ref and anchorEl to...
Read more >
React Popper component - Material UI - MUI
A Popper can be used to display some content on top of another. It's an alternative to react-popper.
Read more >
@mui/system | Yarn - Package Manager
@material-ui/types@6.0.0. This package is just re-released since version 5.1.7 had a breaking change. ... 5.0.0-alpha.31 ... ‍ Migrate 4 components to...
Read more >
mui/material/CHANGELOG.md - UNPKG
549, This is an early release to fix `export 'useId' (imported as 'React') was not found in 'react'` when bundling code depending on...
Read more >
front-end/node_modules/@material-ui/styles/CHANGELOG.md
[core] Introduce useId hook (#20407) @NMinhNguyen; [test] Fix broken tests in react@next (#20472) @eps1lon; [test] Use .checkPropTypes instead of render + ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found