robisim74/angular-l10n

Namespace 'Intl' has no exported member 'RelativeTimeFormatOptions'

Closed this issue · 3 comments

Describe the bug
After upgrading to v13 I'm having issues compiling with the message
Namespace 'Intl' has no exported member 'RelativeTimeFormatOptions'

Error: node_modules/angular-l10n/lib/services/l10n-intl.service.d.ts:39:86 - error TS2694: Namespace 'Intl' has no exported member 'RelativeTimeFormatOptions'.

39     formatRelativeTime(value: any, unit: Intl.RelativeTimeFormatUnit, options?: Intl.RelativeTimeFormatOptions, language?: string): string;

To Reproduce
Steps to reproduce the behavior:

  1. On Angular 13 upgrade angular-l10n to 13
  2. ng serve
  3. See error

Desktop (please complete the following information):

  • OS: Windows 11
  • Browser: Edge
  • Version 95.0.1020.44

Additional context
My tsconfig.json:

{
  "compileOnSave": false,
  "compilerOptions": {
    ...
    "module": "es2020",
    "moduleResolution": "node",
    "experimentalDecorators": true,
    "importHelpers": true,
    "target": "es2015",
    "typeRoots": ["node_modules/@types"],
    "lib": ["es2018", "dom"]
  },
  "angularCompilerOptions": {
    "strictTemplates": false
  }
}

Your tsconfig seems not updated to Angular v13, you shoud have:

"lib": [
      "es2020",
      "dom"
    ]

Thank you, that fixed it.
To be fair, the update migration to Angular v13 didn't set the lib to es2020 but manually setting it fixed the issue

Ok, I updated the release note. Thanks for reporting. Greetings