state-adapt: Compile error with version 0.49.0

Getting a compile error with the newest version 0.49.0 for both state-adapt/core and state-adapt/angular.

Using version 14.2.0 of angular

Error: node_modules/@state-adapt/core/lib/adapters/build-adapter.function.d.ts:20:74 - error TS2536: Type 'P_1' cannot be used to index type 'R & S & { state: (state: State) => State; } & BasicAdapterMethods<State>'. 20 } & BasicAdapterMethods<State> extends infer T_1 ? { [P_1 in keyof T_1]: (R & S & { ~~~~~~~~~~ 21 state: (state: State) => State; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 22 } & BasicAdapterMethods<State>)[P_1]; } : never>["selectors"], 19>;

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 26 (15 by maintainers)

Most upvoted comments

Those are now exported from @state-adapt/rxjs

Ugh. I just discovered that too. It appears this fixes it in my local prod build, but not in your repo. It’s the same general issue, just need to find out where to put it in the source code to get the exact right spot.

If you still want to fix it, you actually need to change line 20 from

} & BasicAdapterMethods<State> extends infer T_1 ? { [P_1 in keyof T_1]: (R & S & {

to

} & BasicAdapterMethods<State> extends infer T_1 ? { [P_1 in Extract<keyof T_1, string>]: (R & S & {

You can also fix this directly in your node_modules if you don’t want to wait. In build-adapter.function.d.ts on line 16.

I forked my stackblitz and moved it to 14.2 and it still compiles. I’ll have to pull down your repo