module: refine module type mismatch error cases#35426
Closed
guybedford wants to merge 1 commit intonodejs:masterfrom
Closed
module: refine module type mismatch error cases#35426guybedford wants to merge 1 commit intonodejs:masterfrom
guybedford wants to merge 1 commit intonodejs:masterfrom
Conversation
Collaborator
|
Review requested:
|
Contributor
Author
|
Ping @nodejs/modules-active-members for review. It could even be worth fast-tracking this. |
bmeck
approved these changes
Sep 30, 2020
Collaborator
guybedford
added a commit
that referenced
this pull request
Oct 1, 2020
PR-URL: #35426 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Bradley Farias <bradley.meck@gmail.com> Reviewed-By: Myles Borins <myles.borins@gmail.com>
Contributor
Author
|
Landed in 726143e. |
4 tasks
guybedford
added a commit
to guybedford/node
that referenced
this pull request
Oct 1, 2020
PR-URL: nodejs#35426 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Bradley Farias <bradley.meck@gmail.com> Reviewed-By: Myles Borins <myles.borins@gmail.com>
Merged
danielleadams
pushed a commit
that referenced
this pull request
Oct 6, 2020
PR-URL: #35426 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Bradley Farias <bradley.meck@gmail.com> Reviewed-By: Myles Borins <myles.borins@gmail.com>
Merged
codebytere
added a commit
to electron/electron
that referenced
this pull request
Oct 8, 2020
4 tasks
aduh95
pushed a commit
to aduh95/node
that referenced
this pull request
Oct 23, 2020
PR-URL: nodejs#35426 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Bradley Farias <bradley.meck@gmail.com> Reviewed-By: Myles Borins <myles.borins@gmail.com>
3 tasks
Merged
joesepi
pushed a commit
to joesepi/node
that referenced
this pull request
Jan 8, 2021
PR-URL: nodejs#35426 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Bradley Farias <bradley.meck@gmail.com> Reviewed-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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This fixes up the error message in the case when importing a CJS module that contains ES module syntax.
Specifically, hiding the cjs-module-lexer parse failure message, and also then surfacing the warning context that informs the user about the "type" and ".mjs" format indicators to be able to correct the underlying issue.
Before this change:
where
module.cjscontainsexport/importsyntax so is not valid CommonJS, would output as per the error in #35425.With this change, we now get an error like:
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes