Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

typescript 4.8 support #1198

Closed
5 tasks done
ameinhardt opened this issue Oct 14, 2022 · 7 comments · Fixed by #1277
Closed
5 tasks done

typescript 4.8 support #1198

ameinhardt opened this issue Oct 14, 2022 · 7 comments · Fixed by #1277
Labels
❗ p4-important Priority 4: bugs that violate documented behavior, or significantly impact perf typescript

Comments

@ameinhardt
Copy link

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

@ameinhardt ameinhardt added the Status: Review Needed Request for review comments label Oct 14, 2022
@nielsvanvelzen
Copy link

Seeing this same issue, here is a (complete?) list of issues found:

> tsc --noEmit
node_modules/@intlify/core-base/dist/core-base.d.ts(192,50): error TS2313: Type parameter 'Context' has a circular constraint.
node_modules/@intlify/core-base/dist/core-base.d.ts(192,75): error TS2536: Type '"datetimeFormats"' cannot be used to index type 'Context'.
node_modules/@intlify/core-base/dist/core-base.d.ts(194,50): error TS2313: Type parameter 'Context' has a circular constraint.
node_modules/@intlify/core-base/dist/core-base.d.ts(194,75): error TS2536: Type '"datetimeFormats"' cannot be used to index type 'Context'.
node_modules/@intlify/core-base/dist/core-base.d.ts(194,222): error TS2344: Type 'Context["datetimeFormats"]' does not satisfy the constraint 'Record<string, any>'.
node_modules/@intlify/core-base/dist/core-base.d.ts(194,222): error TS2536: Type '"datetimeFormats"' cannot be used to index type 'Context'.
node_modules/@intlify/core-base/dist/core-base.d.ts(194,269): error TS2344: Type 'Context["datetimeFormats"]' does not satisfy the constraint 'Record<string, any>'.
node_modules/@intlify/core-base/dist/core-base.d.ts(194,269): error TS2536: Type '"datetimeFormats"' cannot be used to index type 'Context'.
node_modules/@intlify/core-base/dist/core-base.d.ts(194,419): error TS2536: Type '"locale"' cannot be used to index type 'Context'.
node_modules/@intlify/core-base/dist/core-base.d.ts(196,50): error TS2313: Type parameter 'Context' has a circular constraint.
node_modules/@intlify/core-base/dist/core-base.d.ts(196,75): error TS2536: Type '"datetimeFormats"' cannot be used to index type 'Context'.
node_modules/@intlify/core-base/dist/core-base.d.ts(196,222): error TS2344: Type 'Context["datetimeFormats"]' does not satisfy the constraint 'Record<string, any>'.
node_modules/@intlify/core-base/dist/core-base.d.ts(196,222): error TS2536: Type '"datetimeFormats"' cannot be used to index type 'Context'.
node_modules/@intlify/core-base/dist/core-base.d.ts(196,269): error TS2344: Type 'Context["datetimeFormats"]' does not satisfy the constraint 'Record<string, any>'.
node_modules/@intlify/core-base/dist/core-base.d.ts(196,269): error TS2536: Type '"datetimeFormats"' cannot be used to index type 'Context'.
node_modules/@intlify/core-base/dist/core-base.d.ts(196,419): error TS2536: Type '"locale"' cannot be used to index type 'Context'.
node_modules/@intlify/core-base/dist/core-base.d.ts(196,447): error TS2536: Type '"locale"' cannot be used to index type 'Context'.
node_modules/@intlify/core-base/dist/core-base.d.ts(198,50): error TS2313: Type parameter 'Context' has a circular constraint.
node_modules/@intlify/core-base/dist/core-base.d.ts(198,75): error TS2536: Type '"datetimeFormats"' cannot be used to index type 'Context'.
node_modules/@intlify/core-base/dist/core-base.d.ts(198,222): error TS2344: Type 'Context["datetimeFormats"]' does not satisfy the constraint 'Record<string, any>'.
node_modules/@intlify/core-base/dist/core-base.d.ts(198,222): error TS2536: Type '"datetimeFormats"' cannot be used to index type 'Context'.
node_modules/@intlify/core-base/dist/core-base.d.ts(198,269): error TS2344: Type 'Context["datetimeFormats"]' does not satisfy the constraint 'Record<string, any>'.
node_modules/@intlify/core-base/dist/core-base.d.ts(198,269): error TS2536: Type '"datetimeFormats"' cannot be used to index type 'Context'.
node_modules/@intlify/core-base/dist/core-base.d.ts(198,419): error TS2536: Type '"locale"' cannot be used to index type 'Context'.
node_modules/@intlify/core-base/dist/core-base.d.ts(200,50): error TS2313: Type parameter 'Context' has a circular constraint.
node_modules/@intlify/core-base/dist/core-base.d.ts(200,75): error TS2536: Type '"datetimeFormats"' cannot be used to index type 'Context'.
node_modules/@intlify/core-base/dist/core-base.d.ts(200,222): error TS2344: Type 'Context["datetimeFormats"]' does not satisfy the constraint 'Record<string, any>'.
node_modules/@intlify/core-base/dist/core-base.d.ts(200,222): error TS2536: Type '"datetimeFormats"' cannot be used to index type 'Context'.
node_modules/@intlify/core-base/dist/core-base.d.ts(200,269): error TS2344: Type 'Context["datetimeFormats"]' does not satisfy the constraint 'Record<string, any>'.
node_modules/@intlify/core-base/dist/core-base.d.ts(200,269): error TS2536: Type '"datetimeFormats"' cannot be used to index type 'Context'.
node_modules/@intlify/core-base/dist/core-base.d.ts(200,419): error TS2536: Type '"locale"' cannot be used to index type 'Context'.
node_modules/@intlify/core-base/dist/core-base.d.ts(200,447): error TS2536: Type '"locale"' cannot be used to index type 'Context'.
node_modules/@intlify/core-base/dist/core-base.d.ts(526,48): error TS2313: Type parameter 'Context' has a circular constraint.
node_modules/@intlify/core-base/dist/core-base.d.ts(526,77): error TS2536: Type '"numberFormats"' cannot be used to index type 'Context'.
node_modules/@intlify/core-base/dist/core-base.d.ts(528,48): error TS2313: Type parameter 'Context' has a circular constraint.
node_modules/@intlify/core-base/dist/core-base.d.ts(528,77): error TS2536: Type '"numberFormats"' cannot be used to index type 'Context'.
node_modules/@intlify/core-base/dist/core-base.d.ts(528,202): error TS2344: Type 'Context["numberFormats"]' does not satisfy the constraint 'Record<string, any>'.
node_modules/@intlify/core-base/dist/core-base.d.ts(528,202): error TS2536: Type '"numberFormats"' cannot be used to index type 'Context'.
node_modules/@intlify/core-base/dist/core-base.d.ts(528,247): error TS2344: Type 'Context["numberFormats"]' does not satisfy the constraint 'Record<string, any>'.
node_modules/@intlify/core-base/dist/core-base.d.ts(528,247): error TS2536: Type '"numberFormats"' cannot be used to index type 'Context'.
node_modules/@intlify/core-base/dist/core-base.d.ts(528,393): error TS2536: Type '"locale"' cannot be used to index type 'Context'.
node_modules/@intlify/core-base/dist/core-base.d.ts(530,48): error TS2313: Type parameter 'Context' has a circular constraint.
node_modules/@intlify/core-base/dist/core-base.d.ts(530,77): error TS2536: Type '"numberFormats"' cannot be used to index type 'Context'.
node_modules/@intlify/core-base/dist/core-base.d.ts(530,202): error TS2344: Type 'Context["numberFormats"]' does not satisfy the constraint 'Record<string, any>'.
node_modules/@intlify/core-base/dist/core-base.d.ts(530,202): error TS2536: Type '"numberFormats"' cannot be used to index type 'Context'.
node_modules/@intlify/core-base/dist/core-base.d.ts(530,247): error TS2344: Type 'Context["numberFormats"]' does not satisfy the constraint 'Record<string, any>'.
node_modules/@intlify/core-base/dist/core-base.d.ts(530,247): error TS2536: Type '"numberFormats"' cannot be used to index type 'Context'.
node_modules/@intlify/core-base/dist/core-base.d.ts(530,393): error TS2536: Type '"locale"' cannot be used to index type 'Context'.
node_modules/@intlify/core-base/dist/core-base.d.ts(530,421): error TS2536: Type '"locale"' cannot be used to index type 'Context'.
node_modules/@intlify/core-base/dist/core-base.d.ts(532,48): error TS2313: Type parameter 'Context' has a circular constraint.
node_modules/@intlify/core-base/dist/core-base.d.ts(532,77): error TS2536: Type '"numberFormats"' cannot be used to index type 'Context'.
node_modules/@intlify/core-base/dist/core-base.d.ts(532,202): error TS2344: Type 'Context["numberFormats"]' does not satisfy the constraint 'Record<string, any>'.
node_modules/@intlify/core-base/dist/core-base.d.ts(532,202): error TS2536: Type '"numberFormats"' cannot be used to index type 'Context'.
node_modules/@intlify/core-base/dist/core-base.d.ts(532,247): error TS2344: Type 'Context["numberFormats"]' does not satisfy the constraint 'Record<string, any>'.
node_modules/@intlify/core-base/dist/core-base.d.ts(532,247): error TS2536: Type '"numberFormats"' cannot be used to index type 'Context'.
node_modules/@intlify/core-base/dist/core-base.d.ts(532,393): error TS2536: Type '"locale"' cannot be used to index type 'Context'.
node_modules/@intlify/core-base/dist/core-base.d.ts(534,48): error TS2313: Type parameter 'Context' has a circular constraint.
node_modules/@intlify/core-base/dist/core-base.d.ts(534,77): error TS2536: Type '"numberFormats"' cannot be used to index type 'Context'.
node_modules/@intlify/core-base/dist/core-base.d.ts(534,202): error TS2344: Type 'Context["numberFormats"]' does not satisfy the constraint 'Record<string, any>'.
node_modules/@intlify/core-base/dist/core-base.d.ts(534,202): error TS2536: Type '"numberFormats"' cannot be used to index type 'Context'.
node_modules/@intlify/core-base/dist/core-base.d.ts(534,247): error TS2344: Type 'Context["numberFormats"]' does not satisfy the constraint 'Record<string, any>'.
node_modules/@intlify/core-base/dist/core-base.d.ts(534,247): error TS2536: Type '"numberFormats"' cannot be used to index type 'Context'.
node_modules/@intlify/core-base/dist/core-base.d.ts(534,393): error TS2536: Type '"locale"' cannot be used to index type 'Context'.
node_modules/@intlify/core-base/dist/core-base.d.ts(534,421): error TS2536: Type '"locale"' cannot be used to index type 'Context'.
node_modules/@intlify/core-base/dist/core-base.d.ts(785,51): error TS2313: Type parameter 'Context' has a circular constraint.
node_modules/@intlify/core-base/dist/core-base.d.ts(785,72): error TS2536: Type '"messages"' cannot be used to index type 'Context'.
node_modules/@intlify/core-base/dist/core-base.d.ts(785,163): error TS2344: Type 'Context["messages"]' does not satisfy the constraint 'Record<string, any>'.
node_modules/@intlify/core-base/dist/core-base.d.ts(785,163): error TS2536: Type '"messages"' cannot be used to index type 'Context'.
node_modules/@intlify/core-base/dist/core-base.d.ts(785,197): error TS2344: Type 'Context["messages"]' does not satisfy the constraint 'Record<string, any>'.
node_modules/@intlify/core-base/dist/core-base.d.ts(785,197): error TS2536: Type '"messages"' cannot be used to index type 'Context'.
node_modules/@intlify/core-base/dist/core-base.d.ts(787,51): error TS2313: Type parameter 'Context' has a circular constraint.
node_modules/@intlify/core-base/dist/core-base.d.ts(787,72): error TS2536: Type '"messages"' cannot be used to index type 'Context'.
node_modules/@intlify/core-base/dist/core-base.d.ts(787,163): error TS2344: Type 'Context["messages"]' does not satisfy the constraint 'Record<string, any>'.
node_modules/@intlify/core-base/dist/core-base.d.ts(787,163): error TS2536: Type '"messages"' cannot be used to index type 'Context'.
node_modules/@intlify/core-base/dist/core-base.d.ts(787,197): error TS2344: Type 'Context["messages"]' does not satisfy the constraint 'Record<string, any>'.
node_modules/@intlify/core-base/dist/core-base.d.ts(787,197): error TS2536: Type '"messages"' cannot be used to index type 'Context'.
node_modules/@intlify/core-base/dist/core-base.d.ts(789,51): error TS2313: Type parameter 'Context' has a circular constraint.
node_modules/@intlify/core-base/dist/core-base.d.ts(789,72): error TS2536: Type '"messages"' cannot be used to index type 'Context'.
node_modules/@intlify/core-base/dist/core-base.d.ts(789,163): error TS2344: Type 'Context["messages"]' does not satisfy the constraint 'Record<string, any>'.
node_modules/@intlify/core-base/dist/core-base.d.ts(789,163): error TS2536: Type '"messages"' cannot be used to index type 'Context'.
node_modules/@intlify/core-base/dist/core-base.d.ts(789,197): error TS2344: Type 'Context["messages"]' does not satisfy the constraint 'Record<string, any>'.
node_modules/@intlify/core-base/dist/core-base.d.ts(789,197): error TS2536: Type '"messages"' cannot be used to index type 'Context'.
node_modules/@intlify/core-base/dist/core-base.d.ts(789,358): error TS2536: Type '"locale"' cannot be used to index type 'Context'.
node_modules/@intlify/core-base/dist/core-base.d.ts(791,51): error TS2313: Type parameter 'Context' has a circular constraint.
node_modules/@intlify/core-base/dist/core-base.d.ts(791,72): error TS2536: Type '"messages"' cannot be used to index type 'Context'.
node_modules/@intlify/core-base/dist/core-base.d.ts(791,163): error TS2344: Type 'Context["messages"]' does not satisfy the constraint 'Record<string, any>'.
node_modules/@intlify/core-base/dist/core-base.d.ts(791,163): error TS2536: Type '"messages"' cannot be used to index type 'Context'.
node_modules/@intlify/core-base/dist/core-base.d.ts(791,197): error TS2344: Type 'Context["messages"]' does not satisfy the constraint 'Record<string, any>'.
node_modules/@intlify/core-base/dist/core-base.d.ts(791,197): error TS2536: Type '"messages"' cannot be used to index type 'Context'.
node_modules/@intlify/core-base/dist/core-base.d.ts(793,51): error TS2313: Type parameter 'Context' has a circular constraint.
node_modules/@intlify/core-base/dist/core-base.d.ts(793,72): error TS2536: Type '"messages"' cannot be used to index type 'Context'.
node_modules/@intlify/core-base/dist/core-base.d.ts(793,163): error TS2344: Type 'Context["messages"]' does not satisfy the constraint 'Record<string, any>'.
node_modules/@intlify/core-base/dist/core-base.d.ts(793,163): error TS2536: Type '"messages"' cannot be used to index type 'Context'.
node_modules/@intlify/core-base/dist/core-base.d.ts(793,197): error TS2344: Type 'Context["messages"]' does not satisfy the constraint 'Record<string, any>'.
node_modules/@intlify/core-base/dist/core-base.d.ts(793,197): error TS2536: Type '"messages"' cannot be used to index type 'Context'.
node_modules/@intlify/core-base/dist/core-base.d.ts(793,362): error TS2536: Type '"locale"' cannot be used to index type 'Context'.
node_modules/@intlify/core-base/dist/core-base.d.ts(795,51): error TS2313: Type parameter 'Context' has a circular constraint.
node_modules/@intlify/core-base/dist/core-base.d.ts(795,72): error TS2536: Type '"messages"' cannot be used to index type 'Context'.
node_modules/@intlify/core-base/dist/core-base.d.ts(795,163): error TS2344: Type 'Context["messages"]' does not satisfy the constraint 'Record<string, any>'.
node_modules/@intlify/core-base/dist/core-base.d.ts(795,163): error TS2536: Type '"messages"' cannot be used to index type 'Context'.
node_modules/@intlify/core-base/dist/core-base.d.ts(795,197): error TS2344: Type 'Context["messages"]' does not satisfy the constraint 'Record<string, any>'.
node_modules/@intlify/core-base/dist/core-base.d.ts(795,197): error TS2536: Type '"messages"' cannot be used to index type 'Context'.
node_modules/@intlify/core-base/dist/core-base.d.ts(797,51): error TS2313: Type parameter 'Context' has a circular constraint.
node_modules/@intlify/core-base/dist/core-base.d.ts(797,72): error TS2536: Type '"messages"' cannot be used to index type 'Context'.
node_modules/@intlify/core-base/dist/core-base.d.ts(797,163): error TS2344: Type 'Context["messages"]' does not satisfy the constraint 'Record<string, any>'.
node_modules/@intlify/core-base/dist/core-base.d.ts(797,163): error TS2536: Type '"messages"' cannot be used to index type 'Context'.
node_modules/@intlify/core-base/dist/core-base.d.ts(797,197): error TS2344: Type 'Context["messages"]' does not satisfy the constraint 'Record<string, any>'.
node_modules/@intlify/core-base/dist/core-base.d.ts(797,197): error TS2536: Type '"messages"' cannot be used to index type 'Context'.
node_modules/@intlify/core-base/dist/core-base.d.ts(799,51): error TS2313: Type parameter 'Context' has a circular constraint.
node_modules/@intlify/core-base/dist/core-base.d.ts(799,72): error TS2536: Type '"messages"' cannot be used to index type 'Context'.
node_modules/@intlify/core-base/dist/core-base.d.ts(799,163): error TS2344: Type 'Context["messages"]' does not satisfy the constraint 'Record<string, any>'.
node_modules/@intlify/core-base/dist/core-base.d.ts(799,163): error TS2536: Type '"messages"' cannot be used to index type 'Context'.
node_modules/@intlify/core-base/dist/core-base.d.ts(799,197): error TS2344: Type 'Context["messages"]' does not satisfy the constraint 'Record<string, any>'.
node_modules/@intlify/core-base/dist/core-base.d.ts(799,197): error TS2536: Type '"messages"' cannot be used to index type 'Context'.
node_modules/@intlify/core-base/dist/core-base.d.ts(801,51): error TS2313: Type parameter 'Context' has a circular constraint.
node_modules/@intlify/core-base/dist/core-base.d.ts(801,72): error TS2536: Type '"messages"' cannot be used to index type 'Context'.
node_modules/@intlify/core-base/dist/core-base.d.ts(801,163): error TS2344: Type 'Context["messages"]' does not satisfy the constraint 'Record<string, any>'.
node_modules/@intlify/core-base/dist/core-base.d.ts(801,163): error TS2536: Type '"messages"' cannot be used to index type 'Context'.
node_modules/@intlify/core-base/dist/core-base.d.ts(801,197): error TS2344: Type 'Context["messages"]' does not satisfy the constraint 'Record<string, any>'.
node_modules/@intlify/core-base/dist/core-base.d.ts(801,197): error TS2536: Type '"messages"' cannot be used to index type 'Context'.
node_modules/@intlify/core-base/dist/core-base.d.ts(801,359): error TS2536: Type '"locale"' cannot be used to index type 'Context'.
node_modules/@intlify/core-base/dist/core-base.d.ts(803,51): error TS2313: Type parameter 'Context' has a circular constraint.
node_modules/@intlify/core-base/dist/core-base.d.ts(803,72): error TS2536: Type '"messages"' cannot be used to index type 'Context'.
node_modules/@intlify/core-base/dist/core-base.d.ts(803,163): error TS2344: Type 'Context["messages"]' does not satisfy the constraint 'Record<string, any>'.
node_modules/@intlify/core-base/dist/core-base.d.ts(803,163): error TS2536: Type '"messages"' cannot be used to index type 'Context'.
node_modules/@intlify/core-base/dist/core-base.d.ts(803,197): error TS2344: Type 'Context["messages"]' does not satisfy the constraint 'Record<string, any>'.
node_modules/@intlify/core-base/dist/core-base.d.ts(803,197): error TS2536: Type '"messages"' cannot be used to index type 'Context'.
node_modules/@intlify/core-base/dist/core-base.d.ts(805,51): error TS2313: Type parameter 'Context' has a circular constraint.
node_modules/@intlify/core-base/dist/core-base.d.ts(805,72): error TS2536: Type '"messages"' cannot be used to index type 'Context'.
node_modules/@intlify/core-base/dist/core-base.d.ts(805,163): error TS2344: Type 'Context["messages"]' does not satisfy the constraint 'Record<string, any>'.
node_modules/@intlify/core-base/dist/core-base.d.ts(805,163): error TS2536: Type '"messages"' cannot be used to index type 'Context'.
node_modules/@intlify/core-base/dist/core-base.d.ts(805,197): error TS2344: Type 'Context["messages"]' does not satisfy the constraint 'Record<string, any>'.
node_modules/@intlify/core-base/dist/core-base.d.ts(805,197): error TS2536: Type '"messages"' cannot be used to index type 'Context'.
node_modules/@intlify/core-base/dist/core-base.d.ts(807,51): error TS2313: Type parameter 'Context' has a circular constraint.
node_modules/@intlify/core-base/dist/core-base.d.ts(807,72): error TS2536: Type '"messages"' cannot be used to index type 'Context'.
node_modules/@intlify/core-base/dist/core-base.d.ts(807,163): error TS2344: Type 'Context["messages"]' does not satisfy the constraint 'Record<string, any>'.
node_modules/@intlify/core-base/dist/core-base.d.ts(807,163): error TS2536: Type '"messages"' cannot be used to index type 'Context'.
node_modules/@intlify/core-base/dist/core-base.d.ts(807,197): error TS2344: Type 'Context["messages"]' does not satisfy the constraint 'Record<string, any>'.
node_modules/@intlify/core-base/dist/core-base.d.ts(807,197): error TS2536: Type '"messages"' cannot be used to index type 'Context'.
node_modules/@intlify/core-base/dist/core-base.d.ts(809,51): error TS2313: Type parameter 'Context' has a circular constraint.
node_modules/@intlify/core-base/dist/core-base.d.ts(809,72): error TS2536: Type '"messages"' cannot be used to index type 'Context'.
node_modules/@intlify/core-base/dist/core-base.d.ts(809,163): error TS2344: Type 'Context["messages"]' does not satisfy the constraint 'Record<string, any>'.
node_modules/@intlify/core-base/dist/core-base.d.ts(809,163): error TS2536: Type '"messages"' cannot be used to index type 'Context'.
node_modules/@intlify/core-base/dist/core-base.d.ts(809,197): error TS2344: Type 'Context["messages"]' does not satisfy the constraint 'Record<string, any>'.
node_modules/@intlify/core-base/dist/core-base.d.ts(809,197): error TS2536: Type '"messages"' cannot be used to index type 'Context'.
node_modules/@intlify/core-base/dist/core-base.d.ts(809,361): error TS2536: Type '"locale"' cannot be used to index type 'Context'.
node_modules/vue-i18n/dist/vue-i18n.d.ts(299,51): error TS2344: Type 'Messages' does not satisfy the constraint 'Record<string, any>'.
node_modules/vue-i18n/dist/vue-i18n.d.ts(299,74): error TS2344: Type 'Messages' does not satisfy the constraint 'Record<string, any>'.
node_modules/vue-i18n/dist/vue-i18n.d.ts(360,60): error TS2344: Type 'Messages' does not satisfy the constraint 'Record<string, any>'.
node_modules/vue-i18n/dist/vue-i18n.d.ts(360,83): error TS2344: Type 'Messages' does not satisfy the constraint 'Record<string, any>'.
node_modules/vue-i18n/dist/vue-i18n.d.ts(569,81): error TS2344: Type 'DateTimeFormats' does not satisfy the constraint 'Record<string, any>'.
node_modules/vue-i18n/dist/vue-i18n.d.ts(628,79): error TS2344: Type 'NumberFormats' does not satisfy the constraint 'Record<string, any>'.
node_modules/vue-i18n/dist/vue-i18n.d.ts(1075,68): error TS2344: Type 'Messages' does not satisfy the constraint 'Record<string, any>'.
node_modules/vue-i18n/dist/vue-i18n.d.ts(2242,51): error TS2344: Type 'Messages' does not satisfy the constraint 'Record<string, any>'.
node_modules/vue-i18n/dist/vue-i18n.d.ts(2242,74): error TS2344: Type 'Messages' does not satisfy the constraint 'Record<string, any>'.
node_modules/vue-i18n/dist/vue-i18n.d.ts(2430,81): error TS2344: Type 'DateTimeFormats' does not satisfy the constraint 'Record<string, any>'.
node_modules/vue-i18n/dist/vue-i18n.d.ts(2499,79): error TS2344: Type 'NumberFormats' does not satisfy the constraint 'Record<string, any>'.
node_modules/vue-i18n/dist/vue-i18n.d.ts(2886,68): error TS2344: Type 'Messages' does not satisfy the constraint 'Record<string, any>'.
node_modules/vue-i18n/dist/vue-i18n.d.ts(2986,68): error TS2344: Type 'Messages' does not satisfy the constraint 'Record<string, any>'.

@Shinigami92
Copy link

Shinigami92 commented Nov 14, 2022

Tested with 9.2.2 and 9.3.0-beta.6
With both + TS 4.8 I get around 160 compile-time issues
I don't want to set "skipLibCheck": true, because this disables all checks for every dependency, not just vue-i18n

@kazupon kazupon added ❗ p4-important Priority 4: bugs that violate documented behavior, or significantly impact perf typescript and removed Status: Review Needed Request for review comments labels Nov 15, 2022 — with Volta.net
@GbrFrn
Copy link

GbrFrn commented Nov 30, 2022

tested with 9.3.0-beta.10 and got the same results as above.

@carloshenrq
Copy link

My ts version was 4.5.4 got error.
Updated my ts to 4.9.3, vue-tsc to 1.0.10, and vue-i18n to 9.2.2 (was 9.1.9)
Keeps getting build error (same results as above)

   146  node_modules/@intlify/core-base/dist/core-base.d.ts:192
    13  node_modules/vue-i18n/dist/vue-i18n.d.ts:299

This does not happen in <4.7.4.

I've same issue with 4.5.4 (my package-lock.json) is with that version :(

@gbyesiltas
Copy link

Unable to update my Typescript version because of this issue :/

Copy link
Member

kazupon commented Dec 23, 2022

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

Thanks!

@ameinhardt
Copy link
Author

ameinhardt commented Dec 30, 2022

@kazupon : that looks promising, thanks! With updated dependencies, I 'only' get a different error on npm run build:

src/App.vue:19:8 - error TS2339: Property '$t' does not exist on type '{ $: ComponentInternalInstance; $data: {}; $props: Partial<{}> & Omit<Readonly<ExtractPropTypes<{}>> & VNodeProps & AllowedComponentProps & ComponentCustomProps, never>; ... 10 more ...; $watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (args_0: R, args_1: R) => ...'.

19     {{ $t('hello') }}
          ~~
Found 1 error in src/App.vue:19

Is that to be expected? Maybe related to #1190?
( it seems to be related to vue-tsc updated to >1.0 )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
❗ p4-important Priority 4: bugs that violate documented behavior, or significantly impact perf typescript
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants