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

Incompatible with immer-yjs #181

Open
Crisfole opened this issue Jan 11, 2024 · 2 comments
Open

Incompatible with immer-yjs #181

Crisfole opened this issue Jan 11, 2024 · 2 comments

Comments

@Crisfole
Copy link

Love this project. Unfortunately, I tried installing this on a project at work and it collided with immer-yjs:

https://github.com/sep2/immer-yjs/blob/main/packages/immer-yjs/src/immer-yjs.ts#L39C78-L39C78

../node_modules/immer-yjs/src/immer-yjs.ts:39:64 - error TS2345: Argument of type '(v: JSONValue | YMap<any> | YArray<any>) => JSONValue' is not assignable to parameter of type '(value: unknown, index: number, array: unknown[]) => JSONValue'.
  Types of parameters 'v' and 'value' are incompatible.
    Type 'unknown' is not assignable to type 'JSONValue | YMap<any> | YArray<any>'.

39                     arr.splice(retain, 0, ...change.insert.map(toPlainValue))
                                                                  ~~~~~~~~~~~~


Found 1 error in ../node_modules/immer-yjs/src/immer-yjs.ts:39

I have "skipLibCheck": true, in my tsConfig and "exclude": [ ..., "node_modules", "../node_modules" ...]

Is there something I'm missing here. For now I can't use it as is, which is a pity since it's super great!

@tylerlaprade
Copy link

I'm having a similar problem with reduxjs. Even with "skipLibCheck": true, I'm getting tsc errors from inside my node_modules/ folder.

@Crisfole
Copy link
Author

Crisfole commented Feb 6, 2024

@tylerlaprade In the case of immer it's because immer releases typescript directly and so 'skipping' the lib check isn't really an option... I think.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants