node-cross-spawn icon indicating copy to clipboard operation
node-cross-spawn copied to clipboard

error is null

Open steinybot opened this issue 3 years ago • 0 comments

The type from node child_process is:

    interface SpawnSyncReturns<T> {
        pid: number;
        output: Array<T | null>;
        stdout: T;
        stderr: T;
        status: number | null;
        signal: NodeJS.Signals | null;
        error?: Error | undefined;
    }

but I am getting:

TypeError: Cannot read properties of null (reading 'message')

on something like:

    if (subprocess.error !== undefined) {
      this.error = new WebpackError(subprocess.error.message);
    }

steinybot avatar Sep 11 '22 23:09 steinybot