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

Show an understandable error when getBuildInfo failed #898

Open
@sapphi-red

Description

@sapphi-red

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: featurecode contributing to the implementation of a feature and/or user facing functionality

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions