Calling tm(key) emits error "TS2589: Type instantiation is excessively deep and possibly infinite."
See original GitHub issueReporting 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
- Read the Contributing Guidelines
- Read the Documentation
- Check that there isn’t already an issue that reports the same bug to avoid creating a duplicate.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion
- The provided reproduction is a minimal reproducible example of the bug.
Issue Analytics
- State:
- Created a year ago
- Reactions:3
- Comments:10
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
same error when trying to use i18n in plain js(outside component) with
const { t } = i18n.global
Upgrading from
9.1.10
to9.2.2
causes this issue for me withi18n.global.t