-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
module: improve error for invalid package targets #32052
Conversation
057a205
to
0a23621
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Woo! I think the error message doesn't match what we currently allow for exports values but overall looks good!
LGTM pending jkrem's comment |
Good catch @jkrems PTAL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for posting, this is huge for usability.
Would definitely be nice to see the tests covering the message if possible.
For targets that are strings that do not start with `./` or `/` the error will now have additional information about what the programming error is. Closes: nodejs#32034
d4c8b48
to
974e6c0
Compare
@nodejs/modules I've updated based on all feedback. Should work for both ESM + CJS and has a test that checks the error message. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Amazing thanks for driving this one through.
Co-Authored-By: Guy Bedford <guybedford@gmail.com>
Co-Authored-By: Guy Bedford <guybedford@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Feel free to disregard if you disagree, I just feel like a semicolon here is better grammar than -
.
Co-Authored-By: Geoffrey Booth <GeoffreyBooth@users.noreply.github.com>
Co-Authored-By: Geoffrey Booth <GeoffreyBooth@users.noreply.github.com>
Co-Authored-By: Geoffrey Booth <GeoffreyBooth@users.noreply.github.com>
Co-Authored-By: Geoffrey Booth <GeoffreyBooth@users.noreply.github.com>
This comment has been minimized.
This comment has been minimized.
For targets that are strings that do not start with `./` or `/` the error will now have additional information about what the programming error is. Closes: #32034 PR-URL: #32052 Fixes: #32034 Reviewed-By: Geoffrey Booth <webmaster@geoffreybooth.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Jan Krems <jan.krems@gmail.com> Reviewed-By: Guy Bedford <guybedford@gmail.com> Signed-off-by: Myles Borins <myles.borins@gmail.com>
landed in 09a50d3 |
For targets that are strings that do not start with `./` or `/` the error will now have additional information about what the programming error is. Closes: #32034 PR-URL: #32052 Fixes: #32034 Reviewed-By: Geoffrey Booth <webmaster@geoffreybooth.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Jan Krems <jan.krems@gmail.com> Reviewed-By: Guy Bedford <guybedford@gmail.com> Signed-off-by: Myles Borins <myles.borins@gmail.com>
For targets that are strings that do not start with `./` or `/` the error will now have additional information about what the programming error is. Closes: #32034 PR-URL: #32052 Fixes: #32034 Reviewed-By: Geoffrey Booth <webmaster@geoffreybooth.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Jan Krems <jan.krems@gmail.com> Reviewed-By: Guy Bedford <guybedford@gmail.com> Signed-off-by: Myles Borins <myles.borins@gmail.com>
For targets that are strings that do not start with `./` or `/` the error will now have additional information about what the programming error is. Closes: #32034 PR-URL: #32052 Fixes: #32034 Reviewed-By: Geoffrey Booth <webmaster@geoffreybooth.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Jan Krems <jan.krems@gmail.com> Reviewed-By: Guy Bedford <guybedford@gmail.com> Signed-off-by: Myles Borins <myles.borins@gmail.com>
For targets that are strings that do not start with `./` or `/` the error will now have additional information about what the programming error is. Closes: #32034 PR-URL: #32052 Fixes: #32034 Reviewed-By: Geoffrey Booth <webmaster@geoffreybooth.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Jan Krems <jan.krems@gmail.com> Reviewed-By: Guy Bedford <guybedford@gmail.com> Signed-off-by: Myles Borins <myles.borins@gmail.com>
For targets that are strings that do not start with
./
or/
theerror will now have additional information about what the programming
error is.
Closes: #32034
PTAL @nodejs/modules