TypeError: Cannot read properties of null (reading 'toString')
This rather cryptic error is thrown from:
|
console.error(cargo.stderr.toString().trim()); |
... when trying to call cargo.stderr.toString(). The reason is that cargo.stderr may be null if a cargo executable was not found by the call to spawnSync('cargo' /* ... other args... */).
Troubleshooting:
If, when you run which cargo in your usual shell, you get cargo not found or similar, then you need to make sure the cargo executable is both installed and on your shell's path.
Recommendations:
I think ideally this library should have some way of double-checking whether cargo is indeed on-path (I'm not sure what the usual approach for this is), but this kind of environment health-check may arguably be out-of-scope.
At the very least, it would save some onboarding friction if this library could, in the event of cargo.stderr being null, suggest that perhaps cargo is either not installed or not on path.
This rather cryptic error is thrown from:
rust.aws-cdk-lambda/lib/build.ts
Line 178 in 73b8cdb
... when trying to call
cargo.stderr.toString(). The reason is thatcargo.stderrmay benullif acargoexecutable was not found by the call tospawnSync('cargo' /* ... other args... */).Troubleshooting:
If, when you run
which cargoin your usual shell, you getcargo not foundor similar, then you need to make sure thecargoexecutable is both installed and on your shell's path.Recommendations:
I think ideally this library should have some way of double-checking whether
cargois indeed on-path (I'm not sure what the usual approach for this is), but this kind of environment health-check may arguably be out-of-scope.At the very least, it would save some onboarding friction if this library could, in the event of
cargo.stderrbeingnull, suggest that perhaps cargo is either not installed or not on path.