Skip to content

Correct imports when imported in certain setups.#26

Closed
akademy wants to merge 2 commits intomainfrom
jmbw/correct-imports
Closed

Correct imports when imported in certain setups.#26
akademy wants to merge 2 commits intomainfrom
jmbw/correct-imports

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...?!

@akademy akademy closed this Jan 16, 2025
@akademy akademy deleted the jmbw/correct-imports branch January 16, 2025 14:37
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