Blueprint: DateTime 3.9.2 datePickerCore.d.ts 'LocaleUtils' type reference error

Created on 15 Aug 2019  Â·  5Comments  Â·  Source: palantir/blueprint

In datePickerCore.d.ts TypeScript returns this error:
_TS2749: 'LocaleUtils' refers to a value, but is being used as a type here._

This is because react-day-picker exports this as a constant variable and has no interface or type definition.

I will be installing to DateTime 3.12.0 in the meantime. Speaking of which this seems to be a strange SemVer chronology with 3.12.0 being the last release and then 3.9.2 as the follow up.

datetime

Most helpful comment

@elilambnz I’m using Yarn and set the resolutions flag.

”resolutions”: { “@blueprintjs/datetime/react-day-picker”: “7.3.0” }

This is my solution at present. If anyone is using Yarn this is the preferred solution with it.

https://yarnpkg.com/lang/en/docs/selective-version-resolutions/

All 5 comments

I am actually having this issue from any fresh install of the package. The temporary solution that I have come to is to do.

localeUtils?: typeof LocaleUtils;

This is actually react-day-picker's fault and not an issue with the DateTime package. I will fall back to react-day-picker 7.3.0 as this is an issue with 7.3.2 that was updated 12 days ago. The react-day-picker maintains its own types but the maintainer appears to not want to maintain those types. I can close this issue or you may close this issue because it's not on you. But you may find this to be useful information.

Here's a temporary fix until issues with react-day-picker are resolved.

Directly edit your package-lock.json and add the package to dependencies to force version 7.3.0:

"@blueprintjs/datetime": {
    "version": "3.9.2",
    "resolved": "https://registry.npmjs.org/@blueprintjs/datetime/-/datetime-3.9.2.tgz",
    "integrity": "sha512-qHZySOLB7hOAB0gWmT6Yz2q25ufUyGiRAHNXB6Ol3INkOrXhz7qhbK9EDEq1fbRDw7wVg52zh3WNoHX9Lw23zQ==",
    "requires": {
        "@blueprintjs/core": "^3.15.1",
        "classnames": "^2.2",
        "react-day-picker": "^7.3.0",
        "tslib": "^1.9.0"
    },
    "dependencies": {
        "react-day-picker": {
            "version": "7.3.0",
            "resolved": "https://registry.npmjs.org/react-day-picker/-/react-day-picker-7.3.0.tgz",
            "integrity": "sha512-t2kz0Zy4P5U4qwU5YhsBq2QGmypP8L/u+89TSnuD0h4dYKSEDQArFPWfin9gv8erV1ciR1Wzr485TMaYnI7FTw==",
            "requires": {
                "prop-types": "^15.6.2"
            }
        }
    }
}

Then run npm i

@elilambnz I’m using Yarn and set the resolutions flag.

”resolutions”: { “@blueprintjs/datetime/react-day-picker”: “7.3.0” }

This is my solution at present. If anyone is using Yarn this is the preferred solution with it.

https://yarnpkg.com/lang/en/docs/selective-version-resolutions/

Was this page helpful?
0 / 5 - 0 ratings