-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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
Cannot find module '../../../material-ui-styles/src' or its corresponding type declarations. #24112
Comments
@HofmannZ can you please create codesandbox project or reference github project where we can see the repro? That would help us identify the issue faster. |
|
@oliviertassinari at line 61? |
The solution is likely to make the type explicit, as we did to solve mui/mui-x#573. |
Also: ClockPicker, DayPicker, PickersDay and YearPicker. |
@HofmannZ It seems that the issue can be resolved by not using cd packages/material-ui-lab
yarn build:types
cat build/ClockPicker/ClockPicker.d.ts Do you want to migrate the components suffering from this issue to the approach :)? (unless somebody has a better solution, of course) Having to manually define the |
Got a minimal repro with https://github.com/eps1lon/ts-monorepo-type-import-paths that I reported in microsoft/TypeScript#42155. In the meantime we'll need to detect and fix the symptoms. Update, the issue opened was reported as a duplicate of microsoft/TypeScript#39117. |
Over in #24271 I reported a related issue with the same error/phenomenon. IIUC, here the workaround/solution is to stop depending on I don't think that removing the dependency on |
Can we do the same workaround suggested there? |
The TypeScript team might just have fixed the issue in microsoft/TypeScript#39117. |
The fix doesn't work for us (yet). I tested with the latest nightly release of TypeScript (version The fix is based on a heuristic that only triggers when there's a regular |
Does somebody have a cloneable repro that I can use for testing? |
If you're a bit patient while it's being downloaded, you can just use the material-ui repository itself. Roughly:
Oh I see you already sent a PR 👍 |
I meant a codebase that is using Material-UI and failing. |
Current Behavior 😯
The typings of components inside the lab are referencing
import("../../../material-ui-styles/src")
. The components inside the core are fine, so likely not something with our setup.Expected Behavior 🤔
The typings of components in the lab should be referencing
@material-ui/styles
.Steps to Reproduce 🕹
Steps:
DatePicker
form the labtsc
Cannot find module '../../../material-ui/src' or its corresponding type declarations.
Context 🔦
Your Environment 🌎
`npx @material-ui/envinfo`
The text was updated successfully, but these errors were encountered: