summaryrefslogtreecommitdiff
path: root/tests/specs/cache
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2024-09-05 07:25:56 +0100
committerGitHub <noreply@github.com>2024-09-05 08:25:56 +0200
commitacd01eb2b41e37a480943f79cfa28fc220c4baca (patch)
treea9808419bc88099fc811162d000007f6b2c30f9d /tests/specs/cache
parent105c2e336a4312ed1714ab893c57eae2a19068c7 (diff)
feat: Add a hint on error about 'Relative import path ... not prefixed with ...' (#25430)
Running a file like: ``` import "@std/dotenv/load"; ``` Without a mapping in `imports` field of `deno.json` or `dependencies` of `package.json` will now error out with a hint: ``` error: Relative import path "@std/dotenv/load" not prefixed with / or ./ or ../ hint: Try running `deno add @std/dotenv/load` at [WILDCARD]bare_specifier_without_import/main.ts:1:8 ``` Closes https://github.com/denoland/deno/issues/24699 --------- Co-authored-by: David Sherret <dsherret@users.noreply.github.com>
Diffstat (limited to 'tests/specs/cache')
-rw-r--r--tests/specs/cache/with_bare_import/095_cache_with_bare_import.ts.out1
1 files changed, 1 insertions, 0 deletions
diff --git a/tests/specs/cache/with_bare_import/095_cache_with_bare_import.ts.out b/tests/specs/cache/with_bare_import/095_cache_with_bare_import.ts.out
index 2668a6e08..50daf8041 100644
--- a/tests/specs/cache/with_bare_import/095_cache_with_bare_import.ts.out
+++ b/tests/specs/cache/with_bare_import/095_cache_with_bare_import.ts.out
@@ -1,2 +1,3 @@
[WILDCARD]error: Relative import path "foo" not prefixed with / or ./ or ../
+ hint: If you want to use a JSR or npm package, try running `deno add foo`
at file:///[WILDCARD]/095_cache_with_bare_import.ts:[WILDCARD]