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/message/esm_display_syntax_error_import_module.out | |
parent | d610fad39018a7f21904f2f8fa496c21472f05cb (diff) | |
download | android-node-v8-359819e76052f456beeefeef9bed4062b6c9e7b0.tar.gz android-node-v8-359819e76052f456beeefeef9bed4062b6c9e7b0.tar.bz2 android-node-v8-359819e76052f456beeefeef9bed4062b6c9e7b0.zip |
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/message/esm_display_syntax_error_import_module.out')
-rw-r--r-- | test/message/esm_display_syntax_error_import_module.out | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/message/esm_display_syntax_error_import_module.out b/test/message/esm_display_syntax_error_import_module.out new file mode 100644 index 0000000000..77fd63891f --- /dev/null +++ b/test/message/esm_display_syntax_error_import_module.out @@ -0,0 +1,7 @@ +(node:*) ExperimentalWarning: The ESM module loader is experimental. +file:///*/test/fixtures/es-module-loaders/syntax-error-import.mjs:1 +import { foo, notfound } from './module-named-exports'; + ^^^^^^^^ +SyntaxError: The requested module does not provide an export named 'notfound' + at ModuleJob._instantiate (internal/loader/ModuleJob.js:*:*) + at <anonymous> |