Closed smasala closed 1 year ago
I've tried upgrading to latest NX versions and various individual versions using pnpm overrides such as TS, rollup and babel. Could this be a rollup config issue? How does NX react configure rollup differently to the nx storybook builder?
Rollup also complains about not finding globals (also see the nx report
output above (deprecated warning)
No name was provided for external module '@mui/material/Button' in output.globals – guessing 'Button'
https://github.com/rollup/rollup/issues/1514#issuecomment-320438924
Still valid in 14.1.8
We are running into a very similar issue with https://mantine.dev/
If I add e.g. sx
prop to Table
component, it results in the following error when running nx run ui-components:build
:
✖ nx run ui-components:build
Bundling ui-components...
Error during bundle: Error: /home/<user>/Applications/Webdevelopment/libs/ui-components/src/lib/table/table.tsx(11,23): semantic error TS2322: Type '{ children: (0 | Element | undefined)[]; sx: { color: string; }; striped?: boolean | undefined; highlightOnHover?: boolean | undefined; captionSide?: "top" | "bottom" | undefined; ... 260 more ...; onTransitionEndCapture?: TransitionEventHandler<...> | undefined; }' is not assignable to type 'IntrinsicAttributes & TableProps & RefAttributes<HTMLTableElement>'.
Property 'sx' does not exist on type 'IntrinsicAttributes & TableProps & RefAttributes<HTMLTableElement>'.
Bundle failed: ui-components
@smasala I was able to work around this by setting https://pnpm.io/npmrc#shamefully-hoist to true
.
Now it works properly, but note that you do lose some of the strict dependency handling of pnpm as a tradeoff.
I have to change the latest "@types/react".
@smasala The solution for me was to add params onResize
and onResizeCapture
, which are missing in mui interface for some reason
Closing it as it is not an Nx issue but with MUI published interface, and it looks like there is a workaround. We'll bumping out package and types versions as well.
This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.
Current Behavior
I can only replicate this with nx builder.
Storybook can serve it but when you run
nx build:myReactLibrary
then you get the error aboveExpected 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