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

Correct imports when imported in certain setups. #26

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

akademy
Copy link
Member

@akademy akademy commented Jan 13, 2025

I'm seeing several import errors when adding the component via npmjs in an existing project.

Errors are similar to:

ERROR in ./node_modules/@diamondlightsource/sci-react-ui/dist/index.esm.js 6:0-36
Module not found: Error: Can't resolve '@mui/material/Grid2' in '.../frontend/node_modules/@diamondlightsource/sci-react-ui/dist'
Did you mean 'index.js'?
BREAKING CHANGE: The request '@mui/material/Grid2' failed to resolve only because it was resolved as fully specified (probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '.mjs' file, or a '.js' file where the package.json contains '"type": "module"').
The extension in the request is mandatory for it to be fully specified.
Add the extension to the request.

These changes fix this error, but wonder if this isn't a build problem...?!

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

Successfully merging this pull request may close these issues.

1 participant