Comments (8)
"BaseHelper
"-errors, such as those seen in #1787 (comment), should be fixed in v6.3.1
. Please give it a try. 🤞🏼
from ember-intl.
Thanks for creating the issue and documenting your findings. I received a similar report in #1764 and could reproduce the TS issue locally.
I won't be able to work on a fix this week due to EmberFest. At the moment, my gut feeling is, the work may not be trivial, because ember-intl will need to support TypeScript (TS configuration extends @tsconfig/ember
) and Glint (run on the latest version) better in v6.
For now, let me suggest to you and other end-developers to use skipLibCheck: true
, or patch ember-intl
with @ts-ignore
or @ts-expect-error
as needed.
from ember-intl.
Update:
Here are the errors that I got in ember-workshop
, after installing [email protected]
and removing "skipLibCheck": true
in my-app/tsconfig.json
.
Output from pnpm lint:types
../node_modules/.pnpm/[email protected]_@[email protected]_@[email protected][email protected][email protected]/node_modules/ember-intl/helpers/-format-base.d.ts:17:21 - error TS2314: Generic type 'BaseHelperSignature<Value, Options>' requires 2 type argument(s).
17 Signature extends BaseHelperSignature,
~~~~~~~~~~~~~~~~~~~
../node_modules/.pnpm/[email protected]_@[email protected]_@[email protected][email protected][email protected]/node_modules/ember-intl/helpers/-format-base.d.ts:27:3 - error TS2416: Property 'compute' in type 'AbstractHelper<Signature>' is not assignable to the same property in base type 'Helper<Signature>'.
Type '{ (positional: [undefined], namedOptions: Signature["Args"]["Named"] & { allowEmpty: false; }): never; (positional: [undefined], namedOptions: Signature["Args"]["Named"] & { ...; }): void; (positional: Signature["Args"]["Positional"], namedOptions: Signature["Args"]["Named"]): string; }' is not assignable to type '(positional: GetOr<GetOr<Signature, "Args", {}>, "Positional", DefaultPositional>, named: GetOr<GetOr<Signature, "Args", {}>, "Named", object>) => GetOr<...>'.
Types of parameters 'positional' and 'positional' are incompatible.
Type 'GetOr<GetOr<Signature, "Args", {}>, "Positional", DefaultPositional>' is not assignable to type '[undefined]'.
Type 'DefaultPositional | GetOr<Signature, "Args", {}>[keyof GetOr<Signature, "Args", {}> & "Positional"]' is not assignable to type '[undefined]'.
Type 'DefaultPositional' is not assignable to type '[undefined]'.
Target requires 1 element(s) but source may have fewer.
27 compute(
~~~~~~~
../node_modules/.pnpm/[email protected]_@[email protected]_@[email protected][email protected][email protected]/node_modules/ember-intl/helpers/-format-base.d.ts:31:3 - error TS2416: Property 'compute' in type 'AbstractHelper<Signature>' is not assignable to the same property in base type 'Helper<Signature>'.
Type '{ (positional: [undefined], namedOptions: Signature["Args"]["Named"] & { allowEmpty: false; }): never; (positional: [undefined], namedOptions: Signature["Args"]["Named"] & { ...; }): void; (positional: Signature["Args"]["Positional"], namedOptions: Signature["Args"]["Named"]): string; }' is not assignable to type '(positional: GetOr<GetOr<Signature, "Args", {}>, "Positional", DefaultPositional>, named: GetOr<GetOr<Signature, "Args", {}>, "Named", object>) => GetOr<...>'.
31 compute(
~~~~~~~
../node_modules/.pnpm/[email protected]_@[email protected]_@[email protected][email protected][email protected]/node_modules/ember-intl/helpers/-format-base.d.ts:35:3 - error TS2416: Property 'compute' in type 'AbstractHelper<Signature>' is not assignable to the same property in base type 'Helper<Signature>'.
Type '{ (positional: [undefined], namedOptions: Signature["Args"]["Named"] & { allowEmpty: false; }): never; (positional: [undefined], namedOptions: Signature["Args"]["Named"] & { ...; }): void; (positional: Signature["Args"]["Positional"], namedOptions: Signature["Args"]["Named"]): string; }' is not assignable to type '(positional: GetOr<GetOr<Signature, "Args", {}>, "Positional", DefaultPositional>, named: GetOr<GetOr<Signature, "Args", {}>, "Named", object>) => GetOr<...>'.
35 compute(
~~~~~~~
../node_modules/.pnpm/[email protected]_@[email protected]_@[email protected][email protected][email protected]/node_modules/ember-intl/helpers/format-date.d.ts:7:34 - error TS2344: Type '(Omit<DateTimeFormatOptions, "localeMatcher"> & CustomFormatConfig<"date"> & { locale?: string | [string, ...string[]] | undefined; }) | undefined' does not satisfy the constraint 'Record<string, unknown>'.
Type 'undefined' is not assignable to type 'Record<string, unknown>'.
7 BaseHelperSignature<Params[0], Params[1]>
~~~~~~~~~
../node_modules/.pnpm/[email protected]_@[email protected]_@[email protected][email protected][email protected]/node_modules/ember-intl/helpers/format-list.d.ts:7:34 - error TS2344: Type '(FormatListOptions & { locale?: string | [string, ...string[]] | undefined; }) | undefined' does not satisfy the constraint 'Record<string, unknown>'.
Type 'undefined' is not assignable to type 'Record<string, unknown>'.
7 BaseHelperSignature<Params[0], Params[1]>
~~~~~~~~~
../node_modules/.pnpm/[email protected]_@[email protected]_@[email protected][email protected][email protected]/node_modules/ember-intl/helpers/format-message.d.ts:7:34 - error TS2344: Type '(Partial<Record<string, unknown>> & { htmlSafe?: boolean | undefined; locale?: string | [string, ...string[]] | undefined; }) | undefined' does not satisfy the constraint 'Record<string, unknown>'.
Type 'undefined' is not assignable to type 'Record<string, unknown>'.
7 BaseHelperSignature<Params[0], Params[1]>
~~~~~~~~~
../node_modules/.pnpm/[email protected]_@[email protected]_@[email protected][email protected][email protected]/node_modules/ember-intl/helpers/format-number.d.ts:7:34 - error TS2344: Type '(Omit<NumberFormatOptions, "localeMatcher"> & CustomFormatConfig<"number"> & { locale?: string | [string, ...string[]] | undefined; }) | undefined' does not satisfy the constraint 'Record<string, unknown>'.
Type 'undefined' is not assignable to type 'Record<string, unknown>'.
7 BaseHelperSignature<Params[0], Params[1]>
~~~~~~~~~
../node_modules/.pnpm/[email protected]_@[email protected]_@[email protected][email protected][email protected]/node_modules/ember-intl/helpers/format-relative.d.ts:7:34 - error TS2344: Type '(Omit<RelativeTimeFormatOptions, "localeMatcher"> & CustomFormatConfig<"time"> & { unit?: RelativeTimeFormatUnit | undefined; } & { ...; }) | undefined' does not satisfy the constraint 'Record<string, unknown>'.
Type 'undefined' is not assignable to type 'Record<string, unknown>'.
7 BaseHelperSignature<Params[0], Params[1]>
~~~~~~~~~
../node_modules/.pnpm/[email protected]_@[email protected]_@[email protected][email protected][email protected]/node_modules/ember-intl/helpers/format-time.d.ts:7:34 - error TS2344: Type '(Omit<DateTimeFormatOptions, "localeMatcher"> & CustomFormatConfig<"date"> & { locale?: string | [string, ...string[]] | undefined; }) | undefined' does not satisfy the constraint 'Record<string, unknown>'.
Type 'undefined' is not assignable to type 'Record<string, unknown>'.
7 BaseHelperSignature<Params[0], Params[1]>
~~~~~~~~~
../node_modules/.pnpm/[email protected]_@[email protected]_@[email protected][email protected][email protected]/node_modules/ember-intl/helpers/t.d.ts:7:34 - error TS2344: Type 'TOptions | undefined' does not satisfy the constraint 'Record<string, unknown>'.
Type 'undefined' is not assignable to type 'Record<string, unknown>'.
7 BaseHelperSignature<Params[0], Params[1]>
~~~~~~~~~
../node_modules/.pnpm/[email protected]_@[email protected]_@[email protected][email protected][email protected]/node_modules/ember-intl/macros/intl.d.ts:9:57 - error TS2315: Type 'ComputedProperty' is not generic.
9 export default function intl<T>(getterFn: GetterFn<T>): ComputedProperty<T>;
~~~~~~~~~~~~~~~~~~~
../node_modules/.pnpm/[email protected]_@[email protected]_@[email protected][email protected][email protected]/node_modules/ember-intl/macros/intl.d.ts:10:71 - error TS2315: Type 'ComputedProperty' is not generic.
10 export default function intl<T>(key0: string, getterFn: GetterFn<T>): ComputedProperty<T>;
~~~~~~~~~~~~~~~~~~~
../node_modules/.pnpm/[email protected]_@[email protected]_@[email protected][email protected][email protected]/node_modules/ember-intl/macros/intl.d.ts:11:85 - error TS2315: Type 'ComputedProperty' is not generic.
11 export default function intl<T>(key0: string, key1: string, getterFn: GetterFn<T>): ComputedProperty<T>;
~~~~~~~~~~~~~~~~~~~
../node_modules/.pnpm/[email protected]_@[email protected]_@[email protected][email protected][email protected]/node_modules/ember-intl/macros/intl.d.ts:12:99 - error TS2315: Type 'ComputedProperty' is not generic.
12 export default function intl<T>(key0: string, key1: string, key2: string, getterFn: GetterFn<T>): ComputedProperty<T>;
~~~~~~~~~~~~~~~~~~~
../node_modules/.pnpm/[email protected]_@[email protected]_@[email protected][email protected][email protected]/node_modules/ember-intl/macros/intl.d.ts:13:113 - error TS2315: Type 'ComputedProperty' is not generic.
13 export default function intl<T>(key0: string, key1: string, key2: string, key3: string, getterFn: GetterFn<T>): ComputedProperty<T>;
~~~~~~~~~~~~~~~~~~~
../node_modules/.pnpm/[email protected]_@[email protected]_@[email protected][email protected][email protected]/node_modules/ember-intl/macros/intl.d.ts:14:127 - error TS2315: Type 'ComputedProperty' is not generic.
14 export default function intl<T>(key0: string, key1: string, key2: string, key3: string, key4: string, getterFn: GetterFn<T>): ComputedProperty<T>;
~~~~~~~~~~~~~~~~~~~
../node_modules/.pnpm/[email protected]_@[email protected]_@[email protected][email protected][email protected]/node_modules/ember-intl/macros/intl.d.ts:15:141 - error TS2315: Type 'ComputedProperty' is not generic.
15 export default function intl<T>(key0: string, key1: string, key2: string, key3: string, key4: string, key5: string, getterFn: GetterFn<T>): ComputedProperty<T>;
~~~~~~~~~~~~~~~~~~~
../node_modules/.pnpm/[email protected]_@[email protected]_@[email protected][email protected][email protected]/node_modules/ember-intl/macros/intl.d.ts:16:155 - error TS2315: Type 'ComputedProperty' is not generic.
16 export default function intl<T>(key0: string, key1: string, key2: string, key3: string, key4: string, key5: string, key6: string, getterFn: GetterFn<T>): ComputedProperty<T>;
~~~~~~~~~~~~~~~~~~~
../node_modules/.pnpm/[email protected]_@[email protected]_@[email protected][email protected][email protected]/node_modules/ember-intl/macros/intl.d.ts:17:169 - error TS2315: Type 'ComputedProperty' is not generic.
17 export default function intl<T>(key0: string, key1: string, key2: string, key3: string, key4: string, key5: string, key6: string, key7: string, getterFn: GetterFn<T>): ComputedProperty<T>;
~~~~~~~~~~~~~~~~~~~
../node_modules/.pnpm/[email protected]_@[email protected]_@[email protected][email protected][email protected]/node_modules/ember-intl/macros/intl.d.ts:18:183 - error TS2315: Type 'ComputedProperty' is not generic.
18 export default function intl<T>(key0: string, key1: string, key2: string, key3: string, key4: string, key5: string, key6: string, key7: string, key8: string, getterFn: GetterFn<T>): ComputedProperty<T>;
~~~~~~~~~~~~~~~~~~~
../node_modules/.pnpm/[email protected]_@[email protected]_@[email protected][email protected][email protected]/node_modules/ember-intl/macros/intl.d.ts:19:197 - error TS2315: Type 'ComputedProperty' is not generic.
19 export default function intl<T>(key0: string, key1: string, key2: string, key3: string, key4: string, key5: string, key6: string, key7: string, key8: string, key9: string, getterFn: GetterFn<T>): ComputedProperty<T>;
~~~~~~~~~~~~~~~~~~~
../node_modules/.pnpm/[email protected]_@[email protected]_@[email protected][email protected][email protected]/node_modules/ember-intl/macros/intl.d.ts:20:209 - error TS2315: Type 'ComputedProperty' is not generic.
20 export default function intl<T>(key0: string, key1: string, key2: string, key3: string, key4: string, key5: string, key6: string, key7: string, key8: string, key9: string, ...rest: [string | GetterFn<T>][]): ComputedProperty<T>;
~~~~~~~~~~~~~~~~~~~
../node_modules/.pnpm/[email protected]_@[email protected]_@[email protected][email protected][email protected]/node_modules/ember-intl/macros/t.d.ts:28:107 - error TS2315: Type 'ComputedProperty' is not generic.
28 export default function createTranslatedComputedProperty(translationKey: string, options?: MacroOptions): ComputedProperty<ReturnType<IntlService['t']>>;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
from ember-intl.
I run into the issue that IntlService
is declared twice when importing setupIntl
in an integration test. I think the IntlService
types should be imported from ember-intl/services/intl
instead of ember-intl
in addon-test-support/setup-intl.ts
.
from ember-intl.
No new details to add, but confirming I'm also seeing this error posted above:
../node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected]/node_modules/ember-intl/helpers/-format-base.d.ts:17:21 - error TS2314: Generic type 'BaseHelperSignature<Value, Options>' requires 2 type argument(s).
17 Signature extends BaseHelperSignature,
~~~~~~~~~~~~~~~~~~~
../node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected]/node_modules/ember-intl/helpers/-format-base.d.ts:27:3 - error TS2416: Property 'compute' in type 'AbstractHelper<Signature>' is not assignable to the same property in base type 'Helper<Signature>'.
Type '{ (positional: [undefined], namedOptions: Signature["Args"]["Named"] & { allowEmpty: false; }): never; (positional: [undefined], namedOptions: Signature["Args"]["Named"] & { ...; }): void; (positional: Signature["Args"]["Positional"], namedOptions: Signature["Args"]["Named"]): string; }' is not assignable to type '(positional: PositionalArgs<Signature>, named: NamedArgs<Signature>) => GetOrElse<Signature, "Return", unknown>'.
Types of parameters 'positional' and 'positional' are incompatible.
Type 'PositionalArgs<Signature>' is not assignable to type '[undefined]'.
Type 'Signature[] | (unknown extends Signature ? MissingSignatureArgs : keyof Signature extends "Args" | "Return" ? ArgsFor<Signature> : LegacyArgsFor<...>)["Positional"]' is not assignable to type '[undefined]'.
Type 'Signature[]' is not assignable to type '[undefined]'.
Target requires 1 element(s) but source may have fewer.
27 compute(
~~~~~~~
../node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected]/node_modules/ember-intl/helpers/-format-base.d.ts:31:3 - error TS2416: Property 'compute' in type 'AbstractHelper<Signature>' is not assignable to the same property in base type 'Helper<Signature>'.
Type '{ (positional: [undefined], namedOptions: Signature["Args"]["Named"] & { allowEmpty: false; }): never; (positional: [undefined], namedOptions: Signature["Args"]["Named"] & { ...; }): void; (positional: Signature["Args"]["Positional"], namedOptions: Signature["Args"]["Named"]): string; }' is not assignable to type '(positional: PositionalArgs<Signature>, named: NamedArgs<Signature>) => GetOrElse<Signature, "Return", unknown>'.
31 compute(
~~~~~~~
../node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected]/node_modules/ember-intl/helpers/-format-base.d.ts:35:3 - error TS2416: Property 'compute' in type 'AbstractHelper<Signature>' is not assignable to the same property in base type 'Helper<Signature>'.
Type '{ (positional: [undefined], namedOptions: Signature["Args"]["Named"] & { allowEmpty: false; }): never; (positional: [undefined], namedOptions: Signature["Args"]["Named"] & { ...; }): void; (positional: Signature["Args"]["Positional"], namedOptions: Signature["Args"]["Named"]): string; }' is not assignable to type '(positional: PositionalArgs<Signature>, named: NamedArgs<Signature>) => GetOrElse<Signature, "Return", unknown>'.
35 compute(
~~~~~~~
../node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected]/node_modules/ember-intl/helpers/format-date.d.ts:7:34 - error TS2344: Type '(Omit<DateTimeFormatOptions, "localeMatcher"> & CustomFormatConfig<"date"> & { locale?: string | [string, ...string[]] | undefined; }) | undefined' does not satisfy the constraint 'Record<string, unknown>'.
Type 'undefined' is not assignable to type 'Record<string, unknown>'.
7 BaseHelperSignature<Params[0], Params[1]>
~~~~~~~~~
../node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected]/node_modules/ember-intl/helpers/format-list.d.ts:7:34 - error TS2344: Type '(FormatListOptions & { locale?: string | [string, ...string[]] | undefined; }) | undefined' does not satisfy the constraint 'Record<string, unknown>'.
Type 'undefined' is not assignable to type 'Record<string, unknown>'.
7 BaseHelperSignature<Params[0], Params[1]>
~~~~~~~~~
../node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected]/node_modules/ember-intl/helpers/format-message.d.ts:7:34 - error TS2344: Type '(Partial<Record<string, unknown>> & { htmlSafe?: boolean | undefined; locale?: string | [string, ...string[]] | undefined; }) | undefined' does not satisfy the constraint 'Record<string, unknown>'.
Type 'undefined' is not assignable to type 'Record<string, unknown>'.
7 BaseHelperSignature<Params[0], Params[1]>
~~~~~~~~~
../node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected]/node_modules/ember-intl/helpers/format-number.d.ts:7:34 - error TS2344: Type '(Omit<NumberFormatOptions, "localeMatcher"> & CustomFormatConfig<"number"> & { locale?: string | [string, ...string[]] | undefined; }) | undefined' does not satisfy the constraint 'Record<string, unknown>'.
Type 'undefined' is not assignable to type 'Record<string, unknown>'.
7 BaseHelperSignature<Params[0], Params[1]>
~~~~~~~~~
../node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected]/node_modules/ember-intl/helpers/format-relative.d.ts:7:34 - error TS2344: Type '(Omit<RelativeTimeFormatOptions, "localeMatcher"> & CustomFormatConfig<"time"> & { unit?: RelativeTimeFormatUnit | undefined; } & { ...; }) | undefined' does not satisfy the constraint 'Record<string, unknown>'.
Type 'undefined' is not assignable to type 'Record<string, unknown>'.
7 BaseHelperSignature<Params[0], Params[1]>
~~~~~~~~~
../node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected]/node_modules/ember-intl/helpers/format-time.d.ts:7:34 - error TS2344: Type '(Omit<DateTimeFormatOptions, "localeMatcher"> & CustomFormatConfig<"date"> & { locale?: string | [string, ...string[]] | undefined; }) | undefined' does not satisfy the constraint 'Record<string, unknown>'.
Type 'undefined' is not assignable to type 'Record<string, unknown>'.
7 BaseHelperSignature<Params[0], Params[1]>
~~~~~~~~~
../node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected]/node_modules/ember-intl/helpers/t.d.ts:7:34 - error TS2344: Type 'TOptions | undefined' does not satisfy the constraint 'Record<string, unknown>'.
Type 'undefined' is not assignable to type 'Record<string, unknown>'.
7 BaseHelperSignature<Params[0], Params[1]>
On:
from ember-intl.
Can confirm that updating to v6.3.1
resolved the BaseHelper
Glint errors for me. Thank you so much for the fix!
I did notice the following change in behaviour as well: #1813
from ember-intl.
We upgraded to 6.4.0 and are seeing this resolved. Thanks 🥳
from ember-intl.
@chrisvdp Thanks for the update!
from ember-intl.
Related Issues (20)
- Unexpected locale `en-us` after upgrade to ember-intl v6 HOT 6
- A simple, autogenerated integration test fails for a component using a translation in ember-intl 6.1.2 HOT 6
- Bundle size regression in v6.2.0 HOT 3
- Merge this into formatjs HOT 3
- Incompatible with native `ember-source` types HOT 5
- `allowEmpty` class property not respected in v6.3.1 HOT 1
- Extending helpers like FormatDate has braking changes between v6.2.2 and v6.3.0+ HOT 5
- Basic usage results in: You attempted to update `_locale` [...] infinite revalidation bugs, and performance issues, and is not supported. HOT 4
- How to use `publicOnly: true` in Embroider apps HOT 13
- v6 - Error on valid use of `many`: message cannot be parsed: Unknown plural category: many HOT 1
- Deleted
- Plans for v7 release
- Memory leak regression after upgrading to `>= 6.3.0` HOT 3
- Do not blow up the whole page if a variable is missing ? HOT 2
- Vulnerability in dependency `glob-parent` via `broccoli-merge-files` HOT 10
- Create a docs-app that checks `wrapTranslationsWithNamespace: true`
- Create a docs-app that checks fetching translations HOT 1
- Create a docs-app that checks `publicOnly: true`
- Could not find module `eventemitter3` HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ember-intl.