-
-
Notifications
You must be signed in to change notification settings - Fork 377
Closed
Labels
typescript❗ p4-importantPriority 4: bugs that violate documented behavior, or significantly impact perfPriority 4: bugs that violate documented behavior, or significantly impact perf
Description
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/@[email protected]/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/@[email protected]/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 / vuejs/vue-cli#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.
sexnine, nielsvanvelzen, frank-swp, lassesteffen, lostncg and 4 more
Metadata
Metadata
Assignees
Labels
typescript❗ p4-importantPriority 4: bugs that violate documented behavior, or significantly impact perfPriority 4: bugs that violate documented behavior, or significantly impact perf