summaryrefslogtreecommitdiff
path: root/cli/tests/testdata/npm/cjs_require_esm_mjs_error
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2023-07-17 14:00:44 -0400
committerGitHub <noreply@github.com>2023-07-17 14:00:44 -0400
commit7a9f7f34195d74fe60eb48381bc2a32db741ceb7 (patch)
treec10516eda55afebb75f98bbfecd1cc555891e3ce /cli/tests/testdata/npm/cjs_require_esm_mjs_error
parent37241e9b1e2d16cd160d529e69c6a782fff8a8b4 (diff)
fix(node): improve require esm error messages (#19853)
Part of #19842. Closes #19583 Closes #16913
Diffstat (limited to 'cli/tests/testdata/npm/cjs_require_esm_mjs_error')
-rw-r--r--cli/tests/testdata/npm/cjs_require_esm_mjs_error/main.out4
-rw-r--r--cli/tests/testdata/npm/cjs_require_esm_mjs_error/main.ts1
2 files changed, 5 insertions, 0 deletions
diff --git a/cli/tests/testdata/npm/cjs_require_esm_mjs_error/main.out b/cli/tests/testdata/npm/cjs_require_esm_mjs_error/main.out
new file mode 100644
index 000000000..df37e997a
--- /dev/null
+++ b/cli/tests/testdata/npm/cjs_require_esm_mjs_error/main.out
@@ -0,0 +1,4 @@
+error: Uncaught Error: [ERR_REQUIRE_ESM]: require() of ES Module [WILDCARD]esm_mjs.mjs from [WILDCARD]require_mjs.js not supported. Instead change the require to a dynamic import() which is available in all CommonJS modules.
+ at Module.load (node:module:[WILDCARD])
+ [WILDCARD]
+ at Function.Module._load (node:module:[WILDCARD])
diff --git a/cli/tests/testdata/npm/cjs_require_esm_mjs_error/main.ts b/cli/tests/testdata/npm/cjs_require_esm_mjs_error/main.ts
new file mode 100644
index 000000000..2121f1dbb
--- /dev/null
+++ b/cli/tests/testdata/npm/cjs_require_esm_mjs_error/main.ts
@@ -0,0 +1 @@
+import "npm:@denotest/cjs-require-esm-error/require_mjs.js";