-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
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
[TypeScript 3.3.3] The inferred type of 'styles' cannot be named without a reference to @material-ui/core/styles/withStyles #14487
Comments
Is this error message generated for the file that includes that code? The error message references the name |
This is just a copy and paste mistake. Sorry. It complains about that component that you can see in my code snippet. |
Is this similar to microsoft/TypeScript#29221? @screendriver What filesystem are you using (what OS for starters)? |
I'm using macOS 10.14.2 as my working machine and I'm using NixOS in our CI/CD pipeline. It breaks on both machines. microsoft/TypeScript#29221 is about symlinks. I'm not using any symlink. |
Created a repro that is working on codesandbox and locally (ubuntu 18.04 + yarn). Could you provide your own repro? |
Ah! I created a minimal small fresh repo from scratch. In this repository everything works. I tried to reproduce everything in our product repository and now I believe you were right: there are some symlinks and with them the compiler breaks 😳 I don't know why but I did the same things when I created this issue but with a different result. So your referenced issue is now exactly our problem. I will close this one because it is luckily not related to material-ui (though I just see errors from there and not from any other dependency 🤔). Thanks @eps1lon |
Expected Behavior 🤔
Should compile.
Current Behavior 😯
Does not compile. I get the error message
The inferred type of 'MyComponent' cannot be named without a reference to 'myProject/node_modules/@material-ui/core'. This is likely not portable. A type annotation is necessary.
Steps to Reproduce 🕹
I followed the guide in your official docs. Just create a new simple component like this to see the error:
With TypeScript
3.1.6
everything works as expected.Context 🔦
Your Environment 🌎
The text was updated successfully, but these errors were encountered: