Closed morozow closed 1 month ago
Nitpick: If anyone encounters this issue, here is a quick fix for Unix systems using Yarn post-install:
#!/bin/bash
cd ./
find . -type f -name "*.d.ts" -exec sed -i'' -e 's#export = dayjs;*#export default dayjs;#g' {} +
find . -type f -name "index.d.ts" -exec sed -i'' -e '/export { default } from '\''\.\/borders'\'';/d' {} +
find . -type f -name "index.d.ts" -exec sed -i'' -e '/export { default } from '\''\.\/cssGrid'\'';/d' {} +
find . -type f -name "index.d.ts" -exec sed -i'' -e '/export { default } from '\''\.\/display'\'';/d' {} +
find . -type f -name "index.d.ts" -exec sed -i'' -e '/export { default } from '\''\.\/flexbox'\'';/d' {} +
find . -type f -name "index.d.ts" -exec sed -i'' -e '/export { default } from '\''\.\/palette'\'';/d' {} +
find . -type f -name "index.d.ts" -exec sed -i'' -e '/export { default } from '\''\.\/positions'\'';/d' {} +
find . -type f -name "index.d.ts" -exec sed -i'' -e '/export { default } from '\''\.\/sizing'\'';/d' {} +
find . -type f -name "index.d.ts" -exec sed -i'' -e '/export { default } from '\''\.\/spacing'\'';/d' {} +
find . -type f -name "index.d.ts" -exec sed -i'' -e '/export { default } from '\''\.\/style'\'';/d' {} +
find . -type f -name "index.d.ts" -exec sed -i'' -e '/export { default } from '\''\.\/typography'\'';/d' {} +
find . -type f -name "index.d.ts" -exec sed -i'' -e 's#export { default } from '\''\.\/shadows'\'';*#export * from '\''\.\/shadows'\'';#g' {} +
Smth like this into package.json
:
...
"scripts": {
"postinstall": "bash ./bin/post.install.sh",
}
...
That works also for a new age "@mui/x-date-pickers": "^7.16.0",
Are you using @mui/system
directly? Usually, @mui/system
is not required to be installed explicitly if you use Material UI (it's already a dependency)
If you need more help, please provide a CodeSandbox or a repo that we can take a look.
No, I don’t directly use @mui/system
. Upon reviewing my package.json
, the only dependencies
listed are "@mui/icons-material": "^6.0.2"
, "@mui/material": "^6.0.2"
, "@mui/styles": "^6.0.2"
, and "@mui/x-date-pickers": "^7.16.0"
, with "@mui/envinfo": "^2.0.25"
included in devDependencies
. It appears that @mui/envinfo
aggregates all dependencies independently of package.json
. Therefore, the foregoing solution is currently the only fix from my local perspective. Any suggestions? Following a GitHub implementation, it indeed looks like the default
export is missing. What could be the reason for this export?
Details:
index.d.ts
- https://github.com/mui/material-ui/blob/v6.0.2/packages/mui-system/src/typography/index.ts#L1
export { default } from './typography';
./typopgraphy.d.ts
- https://github.com/mui/material-ui/blob/v6.0.2/packages/mui-system/src/typography/typography.d.ts
default
Comparison of suitable imports:
index.d.ts
- https://github.com/mui/material-ui/blob/v6.0.2/packages/mui-system/src/merge/index.ts#L1
export { default } from './merge';
./merge.d.ts
- https://github.com/mui/material-ui/blob/v6.0.2/packages/mui-system/src/merge/merge.d.ts#L1
export default function merge(acc: object, item: object): object;
default
existsNitpick: object
type may not be the most suitable here. Consider using unknown
or any other generic
type that more accurately represents the value
Here are my 2 cents on automating deployment while the above issue remains unresolved: https://github.com/mui/material-ui/issues/43700#issuecomment-2342067775
This Pull Request eliminates undefined exports: https://github.com/mui/material-ui/pull/43702
Please review it and let me know if there are any additional contributions or changes needed.
Additional note: currently in dev
phase as vita
has an exception while built
The problem has been fixed by updating the documentation: https://github.com/mui/material-ui/pull/43747
This issue has been closed. If you have a similar problem but not exactly the same, please open a new issue. Now, if you have additional information related to this issue or things that could help future readers, feel free to leave a comment.
[!NOTE] We value your feedback @morozow! How was your experience with our support team? If you could spare a moment, we'd love to hear your thoughts in this brief Support Satisfaction survey. Your insights help us improve!
Steps to reproduce
Link to live example: local dev as there's no TS completion to build live phase
Description:
@mui/system
, the TypeScript compiler throws the following error:1 export { default } from './typography';
error TS2305: Module '"./typography"' has no exported member 'default'.
1 export { default } from './typography';
System: OS: macOS 14.1.1 Binaries: Node: 20.9.0 - /usr/local/bin/node npm: 10.2.4 - /usr/local/bin/npm pnpm: Not Found Browsers: Chrome: 128.0.6613.120 Edge: Not Found Safari: 17.1 npmPackages: @emotion/react: ^11.13.3 => 11.13.3 @emotion/styled: ^11.13.0 => 11.13.0 @mui/core-downloads-tracker: 6.0.2 @mui/envinfo: ^2.0.25 => 2.0.25 @mui/icons-material: ^6.0.2 => 6.0.2 @mui/material: ^6.0.2 => 6.0.2 @mui/private-theming: 6.0.2 @mui/styled-engine: 6.0.2 @mui/styles: ^6.0.2 => 6.0.2 @mui/system: 6.0.2 @mui/types: 7.2.16 @mui/utils: 6.0.2 @mui/x-date-pickers: ^7.16.0 => 7.16.0 @mui/x-internals: 7.16.0 @types/react: ^18.3.5 => 18.3.5 react: ^18.3.1 => 18.3.1 react-dom: ^18.3.1 => 18.3.1 typescript: ^5.6.2 => 5.6.2