Skip to content

Commit 0d65d88

Browse files
committed
[no-master] Fix scala-js/scala-js#3528: Use console.error(e) to report ES module errors.
Backported from master.
1 parent e2032ac commit 0d65d88

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

js-envs/src/main/scala/org/scalajs/jsenv/nodejs/AbstractNodeJSEnv.scala

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -141,11 +141,8 @@ abstract class AbstractNodeJSEnv(
141141
importerFile.content = {
142142
s"""
143143
|import("${escapeJS(uri)}").catch(e => {
144-
| /* Make sure to fail the process, but give time to Node.js to
145-
| * display a good stack trace before that.
146-
| */
147-
| setTimeout(() => process.exit(1), 100);
148-
| throw e;
144+
| console.error(e);
145+
| process.exit(1);
149146
|});
150147
""".stripMargin
151148
}

0 commit comments

Comments
 (0)