Skip to content

Upgrade to "June 15, 2021 Release" leads to build errors because of Intl.DateTimeFormatOptions#fractionalSecondDigits #2096

Closed
@tomsontom

Description

@tomsontom

🐛 Bug Report

We upgraded our project to the latest version and now we are getting a build failure (on typescript 4.0.x):

../../../../node_modules/@formatjs/ecma402-abstract/types/date-time.d.ts(8,59): error TS2344: Type '"day" | "era" | "hour" | "minute" | "month" | "second" | "timeZoneName" | "weekday" | "year" | "fractionalSecondDigits"' does not satisfy the constraint '"day" | "era" | "hour" | "minute" | "month" | "second" | "timeZoneName" | "weekday" | "year" | "numberingSystem" | "hourCycle" | "dateStyle" | "timeStyle" | "calendar" | "localeMatcher" | "formatMatcher" | "hour12" | "timeZone"'.
  Type '"fractionalSecondDigits"' is not assignable to type '"day" | "era" | "hour" | "minute" | "month" | "second" | "timeZoneName" | "weekday" | "year" | "numberingSystem" | "hourCycle" | "dateStyle" | "timeStyle" | "calendar" | "localeMatcher" | "formatMatcher" | "hour12" | "timeZone"'.

Looking at the git repo I see #1872 introduced a dev package and so spectrum build itself is happy but downstream users are not because the requested "fractionalSecondDigits" is not available unless you upgrade to the latest typescript version (4.3.5)

🤔 Expected Behavior

Upgrading to the latest version just works without the updating typescript version. Or it has to be specified in the release notes what the minimal version of typescript is required.

😯 Current Behavior

Build just fails and has to upgraded to the current typescript version - at the time of this writing 4.3.5 (see below why that might fail in future as well)

💁 Possible Solution

  • Update typescript 4.3.5
  • patch @formatjs/ecma402-abstract/types/date-time.d.ts

One caveat with solution 2 is: microsoft/TypeScript#42945 so there's the potential to get broken again.

🔦 Context

Our product build got broken.

💻 Code Sample

🌍 Your Environment

Software Version(s)
react-spectrum
Browser
Operating System

🧢 Your Company/Team

🕷 Tracking Issue (optional)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions