mirror of
https://github.com/denoland/deno.git
synced 2025-08-04 10:59:13 +00:00
fix(cli): avoid crash on import of invalid module names (#19523)
Fixes https://github.com/denoland/deno/issues/17748 Closes #17770 Co-authored-by: Anton Bershanskiy <bershanskiy@users.noreply.github.com> Co-authored-by: David Sherret <dsherret@users.noreply.github.com>
This commit is contained in:
parent
fa63fd4610
commit
0733943fe7
4 changed files with 36 additions and 1 deletions
6
cli/tests/testdata/npm/dynamic_import_invalid_package_name/main.out
vendored
Normal file
6
cli/tests/testdata/npm/dynamic_import_invalid_package_name/main.out
vendored
Normal file
|
@ -0,0 +1,6 @@
|
|||
Download http://localhost:4545/npm/registry/ws%3A
|
||||
FAILED
|
||||
TypeError: npm package 'ws:' does not exist.
|
||||
at async file:///[WILDCARD]/dynamic_import_invalid_package_name/main.ts:2:3 {
|
||||
code: "ERR_MODULE_NOT_FOUND"
|
||||
}
|
6
cli/tests/testdata/npm/dynamic_import_invalid_package_name/main.ts
vendored
Normal file
6
cli/tests/testdata/npm/dynamic_import_invalid_package_name/main.ts
vendored
Normal file
|
@ -0,0 +1,6 @@
|
|||
try {
|
||||
await import(`npm:${"ws:"}`);
|
||||
} catch (err) {
|
||||
console.log("FAILED");
|
||||
console.log(err);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue