mirror of
https://github.com/denoland/deno.git
synced 2025-10-02 07:01:16 +00:00
fix(npm): resolve dynamic npm imports individually (#24170)
* https://github.com/denoland/deno_npm/pull/57 * https://github.com/denoland/deno_graph/pull/498 Closes https://github.com/denoland/deno/issues/17802
This commit is contained in:
parent
6a356aff13
commit
4bc96c5d2a
19 changed files with 263 additions and 453 deletions
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"args": "run -A main.ts",
|
||||
"output": "main.out"
|
||||
}
|
15
tests/specs/npm/dynamic_npm_resolution_failure/main.out
Normal file
15
tests/specs/npm/dynamic_npm_resolution_failure/main.out
Normal file
|
@ -0,0 +1,15 @@
|
|||
[UNORDERED_START]
|
||||
Download http://localhost:4260/chalk
|
||||
Download http://localhost:4260/@denotest/dep-cannot-parse
|
||||
[UNORDERED_END]
|
||||
Download http://localhost:4260/chalk/chalk-5.0.1.tgz
|
||||
Hi
|
||||
TypeError: Error in @denotest/dep-cannot-parse@1.0.0 parsing version requirement for dependency: @denotest/esm-basic@unknown-scheme:unknown
|
||||
|
||||
Invalid npm version requirement. Unexpected character.
|
||||
unknown-scheme:unknown
|
||||
~
|
||||
at async file:///[WILDLINE]main.ts:5:3 {
|
||||
code: "ERR_MODULE_NOT_FOUND"
|
||||
}
|
||||
Bye
|
9
tests/specs/npm/dynamic_npm_resolution_failure/main.ts
Normal file
9
tests/specs/npm/dynamic_npm_resolution_failure/main.ts
Normal file
|
@ -0,0 +1,9 @@
|
|||
import chalk from "npm:chalk";
|
||||
|
||||
console.log(chalk.green("Hi"));
|
||||
try {
|
||||
await import("npm:@denotest/dep-cannot-parse");
|
||||
} catch (err) {
|
||||
console.log(err);
|
||||
}
|
||||
console.log(chalk.green("Bye"));
|
Loading…
Add table
Add a link
Reference in a new issue