Skip to content

Error: Type 'undefined' is not assignable to type 'RecordProxy<{}>'. #17

@kmjennison

Description

@kmjennison

I'm seeing this error when running yarn dev:

ERROR in /my/path/offline-examples/relay/nextjs/mutations/AddTodoMutation.ts
64:37 Argument of type 'RecordProxy<{}> | null | undefined' is not assignable to parameter of type 'RecordProxy<{}>'.
  Type 'undefined' is not assignable to type 'RecordProxy<{}>'.
    62 | 
    63 |   // Insert the new todo into the Todo List connection
  > 64 |   ConnectionHandler.insertEdgeAfter(conn, newEdge);
       |                                     ^
    65 | }
    66 | 
    67 | function commit(environment: RelayModernEnvironment, text: string, user: any) {

This error is happening with cleared storage on localhost using the packages updated in #16.

I think it's caused by this TypeScript bug, because downgrading to 3.0.1 fixes it:
microsoft/TypeScript#29505

PR incoming to downgrade TypeScript.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions