Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[build-utils] Handle error during readConfigFile() #9542

Merged
merged 3 commits into from
Feb 24, 2023

Conversation

styfle
Copy link
Member

@styfle styfle commented Feb 24, 2023

This fixes a confusing error:

$ vercel build
Vercel CLI 28.16.6
Error: duplicated mapping key in "/vercel/path0/pnpm-lock.yaml" at line 1215, column -164:
      /@react-dnd/asap/4.0.1:
      ^

Copy link
Contributor

@pvdz pvdz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:yay:

return yaml.safeLoad(str, { filename: name }) as T;
}
} catch (error: unknown) {
console.log(`Error while parsing config file: "${name}"`);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should it not tell the user why it was trying to do this, and/or why it can't continue the build now?
Do we not want to print the actual error that was thrown as a way for the user to debug/see what's wrong?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will continue the build. The idea is that whatever tool uses the config file later will have a hard error such as pnpm install

@kodiakhq kodiakhq bot merged commit f0bc207 into main Feb 24, 2023
@kodiakhq kodiakhq bot deleted the add-better-error-read-config-file branch February 24, 2023 18:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: build-utils pr: automerge Automatically merge the PR when checks pass semver: patch PR contains bug fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants