Skip to content

loadSupergraphSdlFromStorage throws TS2869 #3229

@qumberrizvi

Description

@qumberrizvi

Issue Description

Node version: v22.14.0 (lts/jod)
pnpm version: 10.6.4

While building the application, I encounter the following error:

TS2869: Right operand of ?? is unreachable because the left operand is never nullish.

The error is throw in the following file in gateway-js:
supergraphManagers/UplinkSupergraphManager/loadSupergraphSdlFromStorage.ts

At line 163:

throw new UplinkFetcherError(fetchErrorMsg + result.status + ' ' + e.message ?? e);

Possible solution

Change the line to as follows (notice the parenthesis):

throw new UplinkFetcherError(fetchErrorMsg + result.status + ' ' + (e.message ?? e));

or as follows:

throw new UplinkFetcherError(`${fetchErrorMsg} ${result.status}  ${e.message ?? e}`);

Link to Reproduction

https://github.com/qumberrizvi/escrow-backend

Reproduction Steps

Install dependencies:

pnpm install

Start microservices:

pnpm start:dev:ms

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