Closed vinsonchuong closed 1 year ago
tslib is a dependency that comes standard with TypeScript and gets used in the build when the tsconfig has the option importHelpers
set to true
. The easiest solution is for you to npm install tslib
/ yarn add tslib
(or write your app in TypeScript, which is better than regular JS anyway)
It appears this issue may still be occurring and is breaking this CodeSandbox demo that does not have a tslib
dependency in itself. Is it still possible to consider adding a runtime dependency for tslib
in the package.json
within @date-io
?
@HeVictor feel free to open a PR with the correct tslib version. I can quicly publish a new version if it will be ok to merge
@dmtrKovalenko I was also looking into possible solutions to https://github.com/mui/mui-x/issues/8205 I see two possible courses of action:
tslib
as a dependency
or a peer
dependency to the hijri
and jalaali
packagestarget
of the transpiled TS code to ES6
in order to reap the benefit of native support for class extending @date-io
libraries? I couldn't find one... Raising target to ES6
would no longer support IE11 and Opera Mini.I think the minimum supported browsers should match latest http://mui.com (https://mui.com/material-ui/getting-started/supported-platforms/#browser) which explicitly declares that date picker can not support IE11 so I would probably bump a target.
But wait, why we need to add dependency only for 2 packages?
I think the minimum supported browsers should match latest http://mui.com
Well, that's a good point, but on the page you linked there is a link to browserlistrc
file and specifies op_mini all
as supported version and that is either an issue on MUI side (because it has even worse feature support than IE11) or we can't bump the target. 🤔
But wait, why we need to add dependency only for 2 packages?
Well, they are the only ones that have tslib
import in their production (built) code (because they are extending base adapter classes): hijri & jalaali. Whereas other packages like dayjs do not have this dependency.
Ok clear so I think either option is ok.
Have updated my PR in #643 to go with option 1 for the time being
Hello! I'm currently using
@date-io/dayjs@2.0.1
and I'm getting the following error:I see the import in the compiled files
build/index.esm.js
andbuild/index.js
, but there's no runtime dependency specified inpackage.json