Closed
Description
Describe the bug
I can't compile a nuxt.js type script project which uses the DisplayNames
of Intl
I get the error message TS2339: Property 'DisplayNames' does not exist on type 'typeof Intl'.
To Reproduce
Steps to reproduce the behavior:
- Add this script to any nuxt.js typescript project
new Intl.DisplayNames(undefined, { type: 'region' })
Expected behavior
The code should compile to javascript
Instead, I get the error
TS2339: Property 'DisplayNames' does not exist on type 'typeof Intl'.
Additional context
- It seems the DisplayNames was added to typescript itself. See Intl 2021 Updates microsoft/TypeScript#45647
- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DisplayNames
Metadata
Metadata
Assignees
Labels
No labels