Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add a hint on error about 'Relative import path ... not prefixed with ...' #25430

Merged

Conversation

bartlomieju
Copy link
Member

@bartlomieju bartlomieju commented Sep 4, 2024

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 #24699

cli/main.rs Outdated Show resolved Hide resolved
@bartlomieju bartlomieju enabled auto-merge (squash) September 4, 2024 16:27
@bartlomieju bartlomieju merged commit acd01eb into denoland:main Sep 5, 2024
17 checks passed
@bartlomieju bartlomieju deleted the provide_hint_on_relate_import_path branch September 5, 2024 07:22
bartlomieju added a commit that referenced this pull request Sep 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve error messages for naively used packages
3 participants