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.

typescript 4.8 support

See original GitHub issue

Reporting a bug?

With a simple vue 3 and vue-i18n (e.g. v9.2+) typescript (v4.8+) setup, hundreds of circular constraints and index errors are thrown when building (tsc -c)

node_modules/.pnpm/@intlify+core-base@9.3.0-beta.6/node_modules/@intlify/core-base/dist/core-base.d.ts:791:51 - error TS2313: Type parameter 'Context' has a circular constraint.

791 export declare function translate<Context extends CoreContext<Message, Context['messages'], {}, {}>, Key extends string = string, ResourceKeys extends PickupKeys<Context['messages']> = PickupKeys<Context['messages']>, Message = string>(context: Context, key: Key | ResourceKeys | number | MessageFunction<Message>, defaultMsg: string): MessageType<Message> | number;
                                                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/.pnpm/@intlify+core-base@9.3.0-beta.6/node_modules/@intlify/core-base/dist/core-base.d.ts:791:72 - error TS2536: Type '"messages"' cannot be used to index type 'Context'.

791 export declare function translate<Context extends CoreContext<Message, Context['messages'], {}, {}>, Key extends string = string, ResourceKeys extends PickupKeys<Context['messages']> = PickupKeys<Context['messages']>, Message = string>(context: Context, key: Key | ResourceKeys | number | MessageFunction<Message>, defaultMsg: string): MessageType<Message> | number;

This does not happen in <4.7.4. As a workaround, it is possible to "skipLibCheck": true in tsconfig.json. (see https://github.com/vuejs/tsconfig/blob/main/tsconfig.json / https://github.com/vuejs/vue-cli/pull/5688)

Expected behavior

without skipping typescript lib checks, it is possible to use vue-i18n with typescript 4.8+

Reproduction

https://github.com/ameinhardt/tsI18n

System Info

Binaries:
  Node: 16.15.0
  npm: 8.5.5
npmPackages:
  see package-lock.json in reproduction repo

Screenshot

No response

Additional context

No response

Validations

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:9
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
gbyesiltascommented, Dec 13, 2022

Unable to update my Typescript version because of this issue 😕

2reactions
kazuponcommented, Dec 23, 2022

I’ve just released out vue-i18n v9.3.0-beta.11 You can install next dist tag!

Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Announcing TypeScript 4.8 - Microsoft Developer Blogs
Today we're excited to announce the release of TypeScript 4.8! ... Since our beta release, our stable release now has support for excluding ......
Read more >
TypeScript 4.8 Support · Issue #5227 - GitHub
https://devblogs.microsoft.com/typescript/announcing-typescript-4-8-rc/ This issue is just to track all of the new features and their implementation state ...
Read more >
4.8.4 - typescript - npm
TypeScript is a language for application scale JavaScript development. Latest version: 4.9.4, last published: 16 days ago.
Read more >
What's New in TypeScript 4.8 - Visual Studio Magazine
Microsoft released TypeScript 4.8 with a host of new features ranging from Find All References improvements to the ability to exclude ...
Read more >
The Definitive TypeScript 4.8 Guide - SitePen
While TypeScript supports standard JavaScript syntax, it also adds some new syntax, such as type annotations, access modifiers (public, private) ...
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