summaryrefslogtreecommitdiff
path: root/cli/tests/testdata/npm/cjs_require_esm_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_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_error')
-rw-r--r--cli/tests/testdata/npm/cjs_require_esm_error/main.out4
-rw-r--r--cli/tests/testdata/npm/cjs_require_esm_error/main.ts1
2 files changed, 5 insertions, 0 deletions
diff --git a/cli/tests/testdata/npm/cjs_require_esm_error/main.out b/cli/tests/testdata/npm/cjs_require_esm_error/main.out
new file mode 100644
index 000000000..dcb3d15b7
--- /dev/null
+++ b/cli/tests/testdata/npm/cjs_require_esm_error/main.out
@@ -0,0 +1,4 @@
+error: Uncaught Error: [ERR_REQUIRE_ESM]: require() of ES Module [WILDCARD]my_esm_module.js from [WILDCARD]index.js not supported. Instead change the require to a dynamic import() which is available in all CommonJS modules.
+ at Object.Module._extensions..js (node:module:[WILDCARD])
+ [WILDCARD]
+ at Module.load (node:module:[WILDCARD])
diff --git a/cli/tests/testdata/npm/cjs_require_esm_error/main.ts b/cli/tests/testdata/npm/cjs_require_esm_error/main.ts
new file mode 100644
index 000000000..3fbb1215a
--- /dev/null
+++ b/cli/tests/testdata/npm/cjs_require_esm_error/main.ts
@@ -0,0 +1 @@
+import "npm:@denotest/cjs-require-esm-error";