material-ui-pickers icon indicating copy to clipboard operation
material-ui-pickers copied to clipboard

DateTextField definition causes typescript compilation to fail

Open janis91 opened this issue 8 years ago • 8 comments

Environment

Tech Version
material-ui-pickers rc17 (also tested with rc14 -> same result)
material-ui 3.2.0
typescript 3.1.1
React
Browser
Peer library

Steps to reproduce

  1. Install 3.2.0 of material-ui/core package.
  2. Install material-ui-pickers.
  3. Build with typescript (npm start / npm run build)

Expected behavior

Build is successful, like with previous versions of material-ui/core

Actual behavior

Failed to compile.

/***/node_modules/material-ui-pickers/_shared/DateTextField.d.ts
(7,45): An interface may only extend a class or another interface.

For me it seems to be an issue with extending the Omit type. But this is not allowed in TypeScript and therefore fails to compile. Moreover I wondered why this Omit is used at all, because in the comment it is declared as an @internal type definition. I think it should not be used in an external library then.

janis91 avatar Oct 08 '18 07:10 janis91

Same Problem

janhoeck avatar Oct 08 '18 07:10 janhoeck

Same Here

evilass avatar Oct 08 '18 11:10 evilass

When do you expect a release for that ?

tjaskula avatar Oct 11 '18 06:10 tjaskula

How I temporary fixed it:

  1. Run Typescript with "tsc --skipLibCheck"
  2. (Optional) Add // @ts-ignore above a property, if it is not defined

janhoeck avatar Oct 11 '18 08:10 janhoeck

I have same problem. After update "@material-ui/core": "3.2.2"

pafeltowicz avatar Oct 16 '18 19:10 pafeltowicz

This will be fixed in #695

rosskevin avatar Oct 16 '18 20:10 rosskevin

What version of material-ui-pickers was this bug introduced in? I'd rather just revert back to an older, working version for now.

bheklilr avatar Oct 17 '18 14:10 bheklilr

@bheklilr this is a breaking/incompatible type change in @material-ui/core, not this, so you need to downgrade that to < 3.2.

rosskevin avatar Oct 17 '18 15:10 rosskevin