Skip to content

SSR does not handle render errors as intended #465

@birdofpreyru

Description

@birdofpreyru

It looks like if an error happens, it currently calls both resolve() and then reject(), in both cases entering the if-guard that also throws Error('Internal error'). Note that inside resolve() we also assign error = null, but in the if-guard we compare error with undefined. Something is messed up here, and it also shadows the original error.

const resolve = (arg: NodeJS.ReadableStream) => {
if (error !== undefined) throw Error('Internal error');
error = null;
resolveArg(arg);
};
const reject = (arg: unknown) => {
if (error !== undefined && error !== arg) {
throw Error('Internal error');
}
error = arg;
rejectArg(arg as Error);
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1High priority. Important thing to focus on.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions