Skip to content

Property 'cause' does not exist on type 'Json & ExactOptionalGuard' #129

@Taewa

Description

@Taewa

Hi,
My main purpose of using serializeError is to get cause. it works perfectly but I get a following error

Property 'cause' does not exist on type 'Json & ExactOptionalGuard'.

What would be the appropriate type of it? My code is below:

const err = serializeError(e);  // 'e' from smart contract error
const cause = err?.data?.cause?.reason; // Property 'cause' does not exist on type 'Json & ExactOptionalGuard'

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