FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

module: improve error for invalid package targets by MylesBorins · Pull Request #32052 · nodejs/node · GitHub

/ node Public

module: improve error for invalid package targets - #32052

Closed
MylesBorins wants to merge 9 commits into
nodejs:masterfrom
MylesBorins:better-errors
Closed

module: improve error for invalid package targets#32052
MylesBorins wants to merge 9 commits into
nodejs:masterfrom
MylesBorins:better-errors

Conversation

Copy link
Copy Markdown
Contributor

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

PTAL @nodejs/modules

nodejs-github-bot added the errors Issues and PRs related to JavaScript errors originated in Node.js core. label Mar 2, 2020

hybrist left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Woo! I think the error message doesn't match what we currently allow for exports values but overall looks good!

Comment thread lib/internal/errors.js Outdated
Comment thread test/es-module/test-esm-exports.mjs Outdated

ljharb commented Mar 2, 2020

Copy link
Copy Markdown
Member

LGTM pending jkrem's comment

Copy link
Copy Markdown
Contributor Author

Good catch @jkrems PTAL

guybedford left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Thanks for posting, this is huge for usability.

Would definitely be nice to see the tests covering the message if possible.

Comment thread lib/internal/errors.js Outdated
MylesBorins added the esm Issues and PRs related to the ECMAScript Modules implementation. label Mar 10, 2020
MylesBorins mentioned this pull request Mar 11, 2020
3 tasks
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

Copy link
Copy Markdown
Contributor Author

@nodejs/modules I've updated based on all feedback. Should work for both ESM + CJS and has a test that checks the error message.

Copy link
Copy Markdown
Collaborator

Comment thread lib/internal/errors.js Outdated
Comment thread lib/internal/errors.js Outdated

Copy link
Copy Markdown
Collaborator

Comment thread lib/internal/errors.js Outdated
Comment thread lib/internal/errors.js Outdated
Comment thread lib/internal/errors.js
Comment thread lib/internal/errors.js Outdated

guybedford left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Amazing thanks for driving this one through.

Comment thread lib/internal/errors.js Outdated
MylesBorins and others added 2 commits April 20, 2020 22:07
Co-Authored-By: Guy Bedford <guybedford@gmail.com>
Co-Authored-By: Guy Bedford <guybedford@gmail.com>

Copy link
Copy Markdown
Collaborator

GeoffreyBooth left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Feel free to disregard if you disagree, I just feel like a semicolon here is better grammar than -.

Comment thread lib/internal/errors.js Outdated
Comment thread lib/internal/errors.js Outdated
Comment thread lib/internal/errors.js Outdated
Comment thread lib/internal/errors.js Outdated
Co-Authored-By: Geoffrey Booth <GeoffreyBooth@users.noreply.github.com>
MylesBorins and others added 3 commits April 21, 2020 15:38
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.

Copy link
Copy Markdown
Collaborator

Copy link
Copy Markdown
Collaborator

Copy link
Copy Markdown
Collaborator

MylesBorins added a commit that referenced this pull request Apr 22, 2020
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>

Copy link
Copy Markdown
Contributor Author

landed in 09a50d3

BethGriggs pushed a commit that referenced this pull request Apr 27, 2020
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>
BethGriggs mentioned this pull request Apr 27, 2020
BridgeAR pushed a commit that referenced this pull request Apr 28, 2020
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>
BridgeAR mentioned this pull request Apr 28, 2020
targos pushed a commit that referenced this pull request Apr 30, 2020
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>
targos pushed a commit that referenced this pull request May 13, 2020
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

errors Issues and PRs related to JavaScript errors originated in Node.js core. esm Issues and PRs related to the ECMAScript Modules implementation.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

package.exports require "./" in front of path or resolver fails

8 participants


Back | FazBrowse Home | New Git URL