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

Broken @material-ui dependency? #6

Closed
ArcticTee opened this issue Oct 17, 2019 · 9 comments
Closed

Broken @material-ui dependency? #6

ArcticTee opened this issue Oct 17, 2019 · 9 comments
Assignees

Comments

@ArcticTee
Copy link

ArcticTee commented Oct 17, 2019

Hi, I am trying to include your Component in a React project of mine.

Running "@material-ui/core": "^4.3.1",

Getting the following errors:

./node_modules/react-image-annotate/Theme/index.js
Module not found: Can't resolve '@material-ui/core/styles/MuiThemeProvider' in '.../node_modules/react-image-annotate/Theme'

When I go back to a Version 3.9.3 of @material-ui the MuiThemeProvider is found.
But the @material-ui/lab/Slider dependency from material-survey will be lost.

Can't resolve '@material-ui/lab/Slider' in '.../node_modules/material-survey/components/RatingQuestion'

Or it may be related to this

Any suggestions?

@oliviertassinari
Copy link

oliviertassinari commented Oct 17, 2019

Sorry for the trouble, does the import come from the auto-import feature of your IDE?
I would encourage the following:

-import { makeStyles } from "@material-ui/core/styles"
-import createMuiTheme from "@material-ui/core/styles/createMuiTheme"
-import MuiThemeProvider from "@material-ui/core/styles/MuiThemeProvider"
+import {
+  makeStyles,
+  createMuiTheme,
+  MuiThemeProvider,
+} from "@material-ui/core/styles"

These are private imports.

https://github.com/waoai/react-image-annotate/blob/fd8eb7e87cc1bb609a548e167e80d683bfa0dfc0/src/Theme/index.js#L5-L6

@ArcticTee
Copy link
Author

ArcticTee commented Oct 18, 2019

Edited: I guess the fix for your Theme would work.

@oliviertassinari
Copy link

oliviertassinari commented Oct 18, 2019

What do you mean by

@ArcticTee Sorry, it was a question for the author of the package.

This could be a potential workaround: mui/material-ui#17900 (comment).

@ArcticTee
Copy link
Author

ArcticTee commented Oct 18, 2019

@oliviertassinari Sorry, confused you with the author or contributors of this package😂

@oliviertassinari
Copy link

Your best workaround is to freeze @material-ui/core to v4.5.0.

@ArcticTee
Copy link
Author

I solved it by using

    "@material-ui/core": "4.4.0",
    "@material-ui/lab": "4.0.0-alpha.22",

in my package.json

@seveibar
Copy link
Contributor

@ArcticTee thanks for reporting, assigning myself to fix this issue.

@seveibar seveibar self-assigned this Oct 25, 2019
@oliviertassinari
Copy link

Notice that Material-UI v4.5.2 will soon come out with a warning instead of an exception for the import of this private module.

@seveibar
Copy link
Contributor

seveibar commented Nov 8, 2019

fixed in 0.1.28

@seveibar seveibar closed this as completed Nov 8, 2019
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

3 participants