Show an understandable error when getBuildInfo
failed #898
Description
Is your feature request related to a problem? Please describe.
When getBuildInfo
throwed an error, it doesn't show any understandable error and continues the build (and the build fails).
build-image/tests/get-build-info.mjs
Line 4 in 3449ee7
The only error to notice getBuildInfo
failed is:
jq: error (at :1): Cannot iterate over null (null)
Describe the solution you'd like
Show the error thrown from getBuildInfo
and stop the build.
Describe alternatives you've considered
Make @netlify/build-info
resilient to errors.
Additional context
Reproduction: https://github.com/sapphi-red-repros/netlify-pnpm-cannot-iterate-over-repro
Build log: https://app.netlify.com/sites/dashing-marzipan-db6e0f/deploys/63ca28d308f3e100098fe2eb#L30
Running getBuildInfo
in this reproduction will cause the following error:
Error: must not have multiple workspaces with the same name
package 'duplicated' has conflicts in the following paths:
[...omit...]\netlify-pnpm-cannot-iterate-over-repro\packages\bar1\duplicated
[...omit...]\netlify-pnpm-cannot-iterate-over-repro\packages\bar2\duplicated
Can you submit a pull request?
No.
Pull requests are welcome! If you would like to help us add this feature, please check our
contributions guidelines.