typescript 4.8 support
See original GitHub issueReporting 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
- 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:9
- Comments:6 (1 by maintainers)
Top 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 >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
Unable to update my Typescript version because of this issue 😕
I’ve just released out vue-i18n v9.3.0-beta.11 You can install
next
dist tag!Thanks!