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.

Calling tm(key) emits error "TS2589: Type instantiation is excessively deep and possibly infinite."

See original GitHub issue

Reporting a bug?

With Typescript v4.7, the call to tm(key) in the composition API sometimes results in a type error being thrown:

error TS2589: Type instantiation is excessively deep and possibly infinite.

I can’t seem to reproduce it consistently, so my only way of dealing with this for the moment is by sprinkling @ts-ignore’s through my codebase.

Expected behavior

Correct type processing of the Vue I18n composition API.

Reproduction

<div class="container">
  <p v-for="line in tm('lines')">
    {{ rt(line) }}
  </p>
</div>

System Info

System:
    OS: Windows 10 10.0.19043
    CPU: (8) x64 Intel(R) Core(TM) i7-3770K CPU @ 3.50GHz
    Memory: 8.24 GB / 15.94 GB
  Binaries:
    Node: 18.7.0 - C:\Program Files\nodejs\node.EXE
    npm: 8.15.0 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: Spartan (44.19041.1266.0), Chromium (104.0.1293.47)
    @vue/tsconfig: ^0.1.3 => 0.1.3
    vite: ^3.0.5 => 3.0.5
    vue: ^3.2.37 => 3.2.37
    vue-i18n: ^9.2.2 => 9.2.2
    vue-tsc: ^0.40.0 => 0.40.0
    typescript: ~4.7.4 => 4.7.4

Screenshot

No response

Additional context

No response

Validations

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:3
  • Comments:10

github_iconTop GitHub Comments

12reactions
horanscommented, Aug 12, 2022

error TS2589: Type instantiation is excessively deep and possibly infinite.

same error when trying to use i18n in plain js(outside component) with const { t } = i18n.global

3reactions
Krupteincommented, Aug 29, 2022

Upgrading from 9.1.10 to 9.2.2 causes this issue for me with i18n.global.t

Read more comments on GitHub >

github_iconTop Results From Across the Web

TS2589: Type instantiation is excessively deep and possibly ...
Do you want to request a feature or report a bug? bug What is the current behavior? i'm generating interfaces using mongoose-tsgen and...
Read more >
Type instantiation is excessively deep and possibly infinite
The code works but when the input gets long enough, I get the error Type instantiation is excessively deep and possibly infinite. ts(2589)...
Read more >
TypeScript - i18next documentation
TypeScript definitions for i18next can be extended by using Type Augmentation and ... TS2589: Type instantiation is excessively deep and possibly infinite.
Read more >
Roadmap - Vue I18n - Intlify
Calling tm (key) emits error "TS2589: Type instantiation is excessively deep and possibly infinite." Type: Bug ❗ p4-important typescript octicon ...
Read more >
TypeScript. Type instantiation is excessively deep ... - Ilya Zykin
Type instantiation is excessively deep and possibly infinite.ts(2589). Visual Studio Code IDE displays it to ... The problem hides in StyledComponents file.
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