Advertisement
gearmobile

Signal Store Syntax Error

Jun 29th, 2025 (edited)
418
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
TypeScript 3.22 KB | Source Code | 0 0
  1. TS2769: No overload matches this call.
  2. Overload 1 of 45,
  3. (f1: SignalStoreFeature<EmptyFeatureResult, EmptyFeatureResult>, f2: SignalStoreFeature<EmptyFeatureResult, { ...; }>, f3: SignalStoreFeature<...>, f4: SignalStoreFeature<...>, f5: SignalStoreFeature<...>): Type<...>
  4. , gave the following error.
  5. Object literal may only specify known properties, and providedIn does not exist in type
  6. SignalStoreFeature<EmptyFeatureResult, EmptyFeatureResult>
  7. Overload 2 of 45,
  8. (config: { providedIn?: "root" | undefined; protectedState?: true | undefined; }, f1: SignalStoreFeature<EmptyFeatureResult, { state: ShopSlice; props: {}; methods: {}; }>, f2: SignalStoreFeature<...>, f3: SignalStoreFeature<...>, f4: SignalStoreFeature<...>): Type<...>
  9. , gave the following error.
  10. Argument of type 'SignalStoreFeature<{ state: ShopSlice; props: {}; methods: {}; } & { state: {}; props: { productListVm: Signal<ProductListVm>; cartVm: Signal<CartVm>; }; methods: {}; } & { ...; }, EmptyFeatureResult>' is not assignable to parameter of type 'SignalStoreFeature<{ state: ShopSlice; props: {}; methods: {}; } & { state: {}; props: { productListVm: Signal<ProductListVm>; cartVm: Signal<CartVm>; }; methods: {}; } & SignalStoreFeatureResult, EmptyFeatureResult>'.
  11. Types of parameters store and store are incompatible.
  12. Type
  13. InnerSignalStore<ShopSlice & object, {
  14.     productListVm: Signal<ProductListVm>;
  15.     cartVm: Signal<CartVm>;
  16. } & object, MethodsDictionary>
  17. is not assignable to type
  18. InnerSignalStore<ShopSlice, {
  19.     productListVm: Signal<ProductListVm>;
  20.     cartVm: Signal<CartVm>;
  21. }, {
  22.     setSearchWord: (searchWord: string) => void;
  23.     ... 5 more ...;
  24.     checkoutCart: () => void;
  25. }>
  26. Type 'InnerSignalStore<ShopSlice & object, { productListVm: Signal<ProductListVm>; cartVm: Signal<CartVm>; } & object, MethodsDictionary>' is not assignable to type '{ stateSignals: { readonly products: Signal<Product[]>; readonly searchWord: Signal<string>; readonly cartQuantities: Signal<Record<string, number>>; readonly cartVisible: Signal<...>; readonly taxRate: Signal<...>; }; props: { ...; }; methods: { ...; }; hooks: SignalStoreHooks; }'.
  27. Types of property methods are incompatible.
  28. Type MethodsDictionary is missing the following properties from type
  29. {
  30.     setSearchWord: (searchWord: string) => void;
  31.     addToCart: (productId: string) => void;
  32.     viewCart: () => void;
  33.     hideCart: () => void;
  34.     incrementQuantity: (productId: string) => void;
  35.     decrementQuantity: (productId: string) => void;
  36.     checkoutCart: () => void;
  37. }
  38. : setSearchWord, addToCart, viewCart, hideCart, and 3 more.
  39. Overload 3 of 45,
  40. (config: { providedIn?: "root" | undefined; protectedState: false; }, f1: SignalStoreFeature<EmptyFeatureResult, { state: ShopSlice; props: {}; methods: {}; }>, f2: SignalStoreFeature<...>, f3: SignalStoreFeature<...>, f4: SignalStoreFeature<...>): Type<...>
  41. , gave the following error.
  42. Argument of type { providedIn: "root"; } is not assignable to parameter of type
  43. {
  44.     providedIn?: "root" | undefined;
  45.     protectedState: false;
  46. }
  47. Property protectedState is missing in type { providedIn: "root"; } but required in type
  48. {
  49.     providedIn?: "root" | undefined;
  50.     protectedState: false;
  51. }
  52. signal-store.d.ts(95, 5): protectedState is declared here.
Tags: NgRx
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement