Skip to content
This repository has been archived by the owner on Jan 25, 2023. It is now read-only.

Show an understandable error when getBuildInfo failed #898

Open
sapphi-red opened this issue Jan 20, 2023 · 0 comments
Open

Show an understandable error when getBuildInfo failed #898

sapphi-red opened this issue Jan 20, 2023 · 0 comments
Labels
type: feature code contributing to the implementation of a feature and/or user facing functionality

Comments

@sapphi-red
Copy link

sapphi-red commented Jan 20, 2023

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).

const buildInfo = await getBuildInfo({ rootDir, projectDir });

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: feature code contributing to the implementation of a feature and/or user facing functionality
Projects
None yet
Development

No branches or pull requests

1 participant