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

[utils]: Missing dependency on @types/prop-types #39029

Closed
2 tasks done
Methuselah96 opened this issue Sep 17, 2023 · 0 comments · Fixed by #39030
Closed
2 tasks done

[utils]: Missing dependency on @types/prop-types #39029

Methuselah96 opened this issue Sep 17, 2023 · 0 comments · Fixed by #39030
Assignees
Labels
bug 🐛 Something doesn't work package: utils Specific to the @mui/utils package regression A bug, but worse typescript

Comments

@Methuselah96
Copy link
Contributor

Methuselah96 commented Sep 17, 2023

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the latest version

Steps to reproduce 🕹

  1. Create an MUI project using a strict package manager (like Yarn PnP) and skipLibCheck set to false.
  2. Run TypeScript.
  3. Observe type errors.

Current behavior 😯

Type errors:

ERROR in node_modules/@mui/utils/chainPropTypes/chainPropTypes.d.ts:1:23
TS7016: Could not find a declaration file for module 'prop-types'. 'node_modules/prop-types/index.js' implicitly has an 'any' type.
  If the 'prop-types' package actually exposes this module, consider sending a pull request to amend 'https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/prop-types'
  > 1 | import PropTypes from 'prop-types';
      |                       ^^^^^^^^^^^^
    2 | export default function chainPropTypes<A, B>(propType1: PropTypes.Validator<A>, propType2: PropTypes.Validator<B>): PropTypes.Validator<A & B>;
    3 |

ERROR in node_modules/@mui/utils/elementAcceptingRef.d.ts:1:23
TS7016: Could not find a declaration file for module 'prop-types'. 'node_modules/prop-types/index.js' implicitly has an 'any' type.
  If the 'prop-types' package actually exposes this module, consider sending a pull request to amend 'https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/prop-types'
  > 1 | import PropTypes from 'prop-types';
      |                       ^^^^^^^^^^^^
    2 | declare const elementAcceptingRef: PropTypes.Requireable<unknown>;
    3 | export default elementAcceptingRef;
    4 |

ERROR in node_modules/@mui/utils/elementTypeAcceptingRef.d.ts:1:23
TS7016: Could not find a declaration file for module 'prop-types'. 'node_modules/prop-types/index.js' implicitly has an 'any' type.
  If the 'prop-types' package actually exposes this module, consider sending a pull request to amend 'https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/prop-types'
  > 1 | import PropTypes from 'prop-types';
      |                       ^^^^^^^^^^^^
    2 | declare const _default: PropTypes.Validator<PropTypes.ReactComponentLike | null | undefined>;
    3 | export default _default;
    4 |

ERROR in node_modules/@mui/utils/exactProp/exactProp.d.ts:1:31
TS7016: Could not find a declaration file for module 'prop-types'. 'node_modules/prop-types/index.js' implicitly has an 'any' type.
  If the 'prop-types' package actually exposes this module, consider sending a pull request to amend 'https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/prop-types'
  > 1 | import { ValidationMap } from 'prop-types';
      |                               ^^^^^^^^^^^^
    2 | export default function exactProp<T>(propTypes: ValidationMap<T>): ValidationMap<T>;
    3 |

ERROR in node_modules/@mui/utils/refType.d.ts:1:23
TS7016: Could not find a declaration file for module 'prop-types'. 'node_modules/prop-types/index.js' implicitly has an 'any' type.
  If the 'prop-types' package actually exposes this module, consider sending a pull request to amend 'https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/prop-types'
  > 1 | import PropTypes from 'prop-types';
      |                       ^^^^^^^^^^^^
    2 | declare const refType: PropTypes.Requireable<object>;
    3 | export default refType;
    4 |

Expected behavior 🤔

No type errors.

Context 🔦

Looks like @types/prop-types was moved from dependencies to devDependencies in #38859.

Your environment 🌎

N/A

@Methuselah96 Methuselah96 added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Sep 17, 2023
@michaldudak michaldudak self-assigned this Sep 18, 2023
@michaldudak michaldudak added bug 🐛 Something doesn't work typescript package: utils Specific to the @mui/utils package regression A bug, but worse and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Sep 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work package: utils Specific to the @mui/utils package regression A bug, but worse typescript
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants