question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Namespace 'Intl' has no exported member 'RelativeTimeFormat'

See original GitHub issue
  • [Yes] I am on the latest ember-intl version
  • [Yes] I have searched the issues of this repo and believe that this is not a duplicate

Environment

  • Ember Version: 3.23
  • Ember CLI Version: 3.23
  • Ember Intl Version: 5.6.0
  • Browser(s): Firefox 78, Chrome 86
  • Node Version: 12.16.0

Steps to Reproduce

  1. Install latest ember-intl
  2. run ember serve
node_modules/ember-intl/-private/formatters/format-relative.d.ts:49:65 - error TS2694: Namespace 'Intl' has no exported member 'RelativeTimeFormat'.

49     createNativeFormatter: (locales: any, options: any) => Intl.RelativeTimeFormat;
                                                                   ~~~~~~~~~~~~~~~~~~

node_modules/ember-intl/-private/formatters/-base.d.ts:27:138 - error TS2694: Namespace 'Intl' has no exported member 'RelativeTimeFormat'.

27     protected abstract readonly createNativeFormatter: (locales: string | string[], options: KnownOptions) => Intl.DateTimeFormat | Intl.RelativeTimeFormat | Intl.NumberFormat | IntlMessageFormat;
                                                                                                                                            ~~~~~~~~
he same property in base type 'FormatterBase<NumberFormatOptions>'.
  Type 'readonly ("style" | "currency" | "localeMatcher" | "unit" | "currencySign" | "unitDisplay" | "notation" | "compactDisplay" | "signDisplay" | "currencyDisplay" | "useGrouping" | "minimumIntegerDigits" | "minimumSignificantDigits" | "maximumSignificantDigits" | "minimumFractionDigits" | "maximumFractionDigits")[]' is not assignable to type 'readonly ("style" | "currency" | "localeMatcher" | "currencySign" | "currencyDisplay" | "useGrouping" | "minimumIntegerDigits" | "minimumSignificantDigits" | "maximumSignificantDigits" | "minimumFractionDigits" | "maximumFractionDigits")[]'.
    Type '"style" | "currency" | "localeMatcher" | "unit" | "currencySign" | "unitDisplay" | "notation" | "compactDisplay" | "signDisplay" | "currencyDisplay" | "useGrouping" | "minimumIntegerDigits" | "minimumSignificantDigits" | "maximumSignificantDigits" | "minimumFractionDigits" | "maximumFractionDigits"' is not assignable to type '"style" | "currency" | "localeMatcher" | "currencySign" | "currencyDisplay" | "useGrouping" | "minimumIntegerDigits" | "minimumSignificantDigits" | "maximumSignificantDigits" | "minimumFractionDigits" | "maximumFractionDigits"'.
      Type '"unit"' is not assignable to type '"style" | "currency" | "localeMatcher" | "currencySign" | "currencyDisplay" | "useGrouping" | "minimumIntegerDigits" | "minimumSignificantDigits" | "maximumSignificantDigits" | "minimumFractionDigits" | "maximumFractionDigits"'.

13     get options(): readonly ("style" | "currency" | "unit" | "localeMatcher" | "currencyDisplay" | "currencySign" | "useGrouping" | "minimumIntegerDigits" | "minimumFractionDigits" | "maximumFractionDigits" | "minimumSignificantDigits" | "maximumSignificantDigits" | "compactDisplay" | "notation" | "signDisplay" | "unitDisplay")[];
           ~~~~~~~

image

I’m getting this on the latest ember-intl only. After downgrading to 5.5.1 all the errors disappeared

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
gentoidcommented, Jan 17, 2021

Ok, I could finally check this. And yes, I can confirm that updating target to “es2020” solved the issue. Closing it. Thanks!

2reactions
makepaniccommented, Jan 4, 2021

Can you check if your tsconfig is similar to the default ember-cli-typescript tsconfig blueprint? It might be that your “target” is outdated.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Namespace 'Intl' has no exported member 'LocalesArgument'
LocalesArgument I get an error saying Namespace 'Intl' has no exported member 'LocalesArgument' . My tsconfig.json is below and I have tried ...
Read more >
@formatjs/intl-relativetimeformat - npm
Start using @formatjs/intl-relativetimeformat in your project by running ... TypeScript icon, indicating that this package has built-in type ...
Read more >
Intl.RelativeTimeFormat - JavaScript - MDN Web Docs - Mozilla
Returns an Array of objects representing the relative time format in parts that can be used for custom locale-aware formatting. Intl.RelativeTimeFormat.
Read more >
Module Has No Exported Member? : r/typescript - Reddit
It just exports a single namespace, not individual types. It's not tree-shaking compatible either.
Read more >
Overview | Format.JS
Intl.RelativeTimeFormat: This can be polyfilled using this package. ... If you're using react-intl in React Native, make sure your runtime has built-in Intl...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found