diff options
author | Michaël Zasso <targos@protonmail.com> | 2017-12-20 10:42:24 +0100 |
---|---|---|
committer | Michaël Zasso <targos@protonmail.com> | 2017-12-24 17:38:36 +0100 |
commit | 359819e76052f456beeefeef9bed4062b6c9e7b0 (patch) | |
tree | d8529eb88ca98a9714ea159d97daa3906e24578b /test/fixtures | |
parent | d610fad39018a7f21904f2f8fa496c21472f05cb (diff) | |
download | node-new-359819e76052f456beeefeef9bed4062b6c9e7b0.tar.gz |
module: print better message on esm import error
Use the same approach as a previous PR to include the offending line in
the output and underline imports of inexistent exports.
PR-URL: https://github.com/nodejs/node/pull/17786
Fixes: https://github.com/nodejs/node/issues/17785
Refs: https://github.com/nodejs/node/pull/17281
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Guy Bedford <guybedford@gmail.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'test/fixtures')
-rw-r--r-- | test/fixtures/es-module-loaders/module-named-exports.mjs | 2 | ||||
-rw-r--r-- | test/fixtures/es-module-loaders/syntax-error-import.mjs | 1 |
2 files changed, 3 insertions, 0 deletions
diff --git a/test/fixtures/es-module-loaders/module-named-exports.mjs b/test/fixtures/es-module-loaders/module-named-exports.mjs new file mode 100644 index 0000000000..04f7f43ebd --- /dev/null +++ b/test/fixtures/es-module-loaders/module-named-exports.mjs @@ -0,0 +1,2 @@ +export const foo = 'foo'; +export const bar = 'bar'; diff --git a/test/fixtures/es-module-loaders/syntax-error-import.mjs b/test/fixtures/es-module-loaders/syntax-error-import.mjs new file mode 100644 index 0000000000..9cad68c7ce --- /dev/null +++ b/test/fixtures/es-module-loaders/syntax-error-import.mjs @@ -0,0 +1 @@ +import { foo, notfound } from './module-named-exports'; |