Skip to content

Compilation error with viem + permissionless.js + zerodev sdk on NestJS app #184

@yaniferhaoui

Description

@yaniferhaoui

I've created this small project to let you reproduce the compilation errors: https://github.com/yaniferhaoui/viem-permissionless-zerodev-bug/

Running nest start --watch fail because of some compilation errors

node_modules/viem/utils/signature/hashTypedData.ts:151:44 - error TS2345: Argument of type 'unknown[]' is not assignable to parameter of type '(readonly (readonly (readonly (readonly (readonly (readonly (readonly (readonly (readonly (readonly (readonly ...[])[])[])[])[])[])[])[])[])[])[] | readonly (readonly (readonly (readonly (readonly any[])[])[])[])[])[]'.
  Type 'unknown' is not assignable to type 'readonly (readonly (readonly (readonly (readonly (readonly (readonly (readonly (readonly (readonly (readonly ...[])[])[])[])[])[])[])[])[])[])[] | readonly (readonly (readonly (readonly (readonly any[])[])[])[])[]'.

151   return encodeAbiParameters(encodedTypes, encodedValues)
                                               ~~~~~~~~~~~~~

node_modules/viem/utils/transaction/parseTransaction.ts:295:5 - error TS2322: Type 'ToBlobSidecarsReturnType<"bytes" | "hex">' is not assignable to type 'false | readonly BlobSidecar<`0x${string}`>[]'.
  Type 'BlobSidecars<Uint8Array>' is not assignable to type 'false | readonly BlobSidecar<`0x${string}`>[]'.
    Type 'BlobSidecar<Uint8Array>[]' is not assignable to type 'readonly BlobSidecar<`0x${string}`>[]'.
      Type 'BlobSidecar<Uint8Array>' is not assignable to type 'BlobSidecar<`0x${string}`>'.
        Type 'Uint8Array' is not assignable to type '`0x${string}`'.

295     transaction.sidecars = toBlobSidecars({
        ~~~~~~~~~~~~~~~~~~~~

node_modules/viem/utils/transaction/serializeTransaction.ts:248:7 - error TS2322: Type 'ToBlobSidecarsReturnType<"bytes" | "hex">' is not assignable to type 'false | readonly BlobSidecar<`0x${string}`>[]'.
  Type 'BlobSidecars<Uint8Array>' is not assignable to type 'false | readonly BlobSidecar<`0x${string}`>[]'.
    Type 'BlobSidecar<Uint8Array>[]' is not assignable to type 'readonly BlobSidecar<`0x${string}`>[]'.
      Type 'BlobSidecar<Uint8Array>' is not assignable to type 'BlobSidecar<`0x${string}`>'.
        Type 'Uint8Array' is not assignable to type '`0x${string}`'.

248       sidecars = toBlobSidecars({ blobs, commitments, proofs })
          ~~~~~~~~

[5:38:52 PM] Found 322 errors. Watching for file changes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions