Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Breaks when there is a chain of default+named export (@mui/material ClickAwayListener) #133

Open
oxc opened this issue Sep 2, 2024 · 0 comments

Comments

@oxc
Copy link

oxc commented Sep 2, 2024

A recent update of @mui/material changed the ClickAwayListener to be a named export (within the project), not a default export (from outside of the project). (mui/material-ui@24945d4#diff-a583d9ec23bc3ec454a7d0577a5c772c702baf18a9dabc9f635b0546ccfd3fb3)

Regardless of whether I import as named or default import...

import { ClickAwayListener } from '@mui/material';
import ClickAwayListener from '@mui/material/ClickAwayListener';

... babel-plugin-direct-import rewrites this to

import ClickAwayListener from  '@mui/material/ClickAwayListener/ClickAwayListener.js';

... which does not exist, resulting in the following error:

export 'default' (imported as 'ClickAwayListener') was not found in '@mui/material/ClickAwayListener/ClickAwayListener.js' (possible exports: ClickAwayListener)

I tried to debug where the named import gets lost along the way, and why, but I couldn't figure it out quickly. I hope you know from the top of your head where this happens, otherwise I will try to build a minimal example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant