-
-
Notifications
You must be signed in to change notification settings - Fork 645
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
Cryptic error when package.json
is missing a name
#20859
Labels
backend: JavaScript
JavaScript backend-related issues
bug
diagnostics
Poor diagnostics, error messages that could be improved
Comments
yjabri
changed the title
Cryptic Error When
Cryptic error when Apr 29, 2024
package.json
is missing a Namepackage.json
is missing a name
huonw
added
bug
backend: JavaScript
JavaScript backend-related issues
diagnostics
Poor diagnostics, error messages that could be improved
and removed
enhancement
labels
Apr 29, 2024
Thanks for the reproducer. I can reproduce. For someone debugging, here's the stack trace output
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
backend: JavaScript
JavaScript backend-related issues
bug
diagnostics
Poor diagnostics, error messages that could be improved
Is your feature request related to a problem? Please describe.
I was trying out the experimental JavaScript backend and running some "unfriendly" behavior. I've included a minimal reproduction repo to try the following in.
Run
pants tailor ::
. It populatesfoo/BUILD
withRun
pants tailor ::
again. You'll getIn a non minimal repo I had
package_json()
populate likepackage_json(name="foo0")
since I had a python distribution with the same name. GivenKeyError: 'name'
it feels liketailor
is writing an invalid target to the BUILD file. Also runningpants help targets package_json
doesn't enumerate aname
field.It took me some time to realize this had nothing to do with the BUILD file but instead that my
package.json
was missing a name.Describe the solution you'd like
A more explicit message should be given to the caller that
package.json
needs to have a name the first timepants tailor
(or any goal that consumes the file) is called.Describe alternatives you've considered
Additional context
The text was updated successfully, but these errors were encountered: