Skip to content

Errors seem silenced when yarn --version check fails #677

@josegonzalez

Description

@josegonzalez

I had an app that used a fontawesome api token in the .yarnrc.yml. Building this app without the environment variable caused build failures, but the error was not output so it took a few days to figure out the reason.

I think the code for that is here. My rust isn't great, but I think the buildpack just isn't outputting the errors for the user to see if that check fails.

Here is a .yarnrc.yml to use for repro:

nodeLinker: node-modules

npmScopes:
  fortawesome:
    npmAlwaysAuth: true
    npmAuthToken: "${FONTAWESOME_NPM_AUTH_TOKEN}"
    npmRegistryServer: "https://npm.fontawesome.com/"

yarnPath: .yarn/releases/yarn-3.5.1.cjs

And here is the output when that variable is missing and you call yarn --version

Usage Error: Environment variable not found (FONTAWESOME_NPM_AUTH_TOKEN) in /workspace/.yarnrc.yml (in /workspace/.yarnrc.yml)

The same issue exists in the v2a buildpack but that one has a different fix as it is written in shell.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions