From 5401785b217b076263937003075b3b3a8fb7931a Mon Sep 17 00:00:00 2001 From: Manuel Raynaud Date: Mon, 23 Sep 2019 14:23:03 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=8F=B7=EF=B8=8F(frontend)=20fix=20intl=20?= =?UTF-8?q?type=20breakage=20from=20dependency?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We relied on having a type definition for `Intl.RelativeTimeFormat` as we believed it existed in the typescript libs. It was really coming from one of our dependencies extending `Intl` with it. We can just type assert as the only call that uses `RelativeTimeFormat` is to assert whether or not to run a polyfill. --- src/frontend/index.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/frontend/index.tsx b/src/frontend/index.tsx index 2c2f7236e4..91d16e884b 100644 --- a/src/frontend/index.tsx +++ b/src/frontend/index.tsx @@ -37,8 +37,8 @@ document.addEventListener('DOMContentLoaded', async event => { if (!Intl.PluralRules) { await import('intl-pluralrules'); } - - if (!Intl.RelativeTimeFormat) { + // TODO: remove type assertion when typescript libs include RelativeTimeFormat + if (!(Intl as any).RelativeTimeFormat) { await import('@formatjs/intl-relativetimeformat'); // Get `react-intl`/`formatjs` lang specific parameters and data await import(