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

Type error: Type Storage does not satisfy the constraint LsonObject. in liveblocks.config.ts #1498

Open
vignesh-gupta opened this issue Feb 29, 2024 Discussed in #1497 · 0 comments

Comments

@vignesh-gupta
Copy link

vignesh-gupta commented Feb 29, 2024

Discussed in #1497

Originally posted by vignesh-gupta February 29, 2024
Post upgrading from @liveblocks/client 1.9.7 to 1.10.0 . Starting receiving a type issue with Storage in liveblocks.config.ts.

Here is the error:

Type error: Type 'Storage' does not satisfy the constraint 'LsonObject'.
  Property 'layers' is incompatible with index signature.
    Type 'LiveMap<string, LiveObject<Layer>>' is not assignable to type 'Lson | undefined'.
      Type 'LiveMap<string, LiveObject<Layer>>' is not assignable to type 'LiveMap<string, Lson>'.
        The types returned by 'get(...)' are incompatible between these types.
          Type 'LiveObject<Layer> | undefined' is not assignable to type 'Lson | undefined'.
            Type 'LiveObject<Layer>' is not assignable to type 'Lson | undefined'.
              Type 'LiveObject<Layer>' is not assignable to type 'LiveObject<LsonObject>'.
                Types of property 'set' are incompatible.
                  Type '<TKey extends "type" | "x" | "y" | "height" | "width" | "fill" | "value">(key: TKey, value: Layer[TKey]) => void' is not assignable to type '<TKey extends string | number>(key: TKey, value: LsonObject[TKey]) => void'.
                    Types of parameters 'key' and 'key' are incompatible.
                      Type 'TKey' is not assignable to type '"type" | "x" | "y" | "height" | "width" | "fill" | "value"'.
                        Type 'string | number' is not assignable to type '"type" | "x" | "y" | "height" | "width" | "fill" | "value"'.
                          Type 'string' is not assignable to type '"type" | "x" | "y" | "height" | "width" | "fill" | "value"'.
   97 |     useRemoveReaction
   98 |   }
>  99 | } = createRoomContext<Presence, Storage, UserMeta, RoomEvent, ThreadMetadata>(
      |                                 ^
  100 |   client,
  101 |   {
  102 |     async resolveUsers({ userIds }) {

Steps to reproduce:

  1. Clone https://github.com/vignesh-gupta/boardy
  2. Checkout dependabot/npm_and_yarn/liveblocks/client-1.10.0
  3. Run npm i
  4. check liveblocks.config.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants