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

import map affects deno run npm:<package> #23736

Open
Ettapp opened this issue May 8, 2024 · 0 comments
Open

import map affects deno run npm:<package> #23736

Ettapp opened this issue May 8, 2024 · 0 comments

Comments

@Ettapp
Copy link

Ettapp commented May 8, 2024

Version: Deno 1.43.1

Example given by the doc: https://docs.deno.com/runtime/manual/basics/import_maps#example---using-project-root-for-absolute-imports

{
  "imports": {
    "/": "./",
    "./": "./"
  }
}

This seems to affect the way paths are resolved when using a command like deno run npm:<package>.

For example, with the above configuration in deno.json, the command deno run npm:openapi-typescript ... will fail with the error:

error: Module not found "file:///home/user/project-dir/home/user/.cache/deno/npm/registry.npmjs.org/openapi-typescript/6.7.5/bin/cli.js".

As you can see, /home/user/.cache/... has not been used like an absolute path but has been added to the project dir.

Not sure if this is an issue with the example given by the doc or the path resolving using import map.


Explicitly removing the use of config file solve the issue: deno run --no-config npm:<package>

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

No branches or pull requests

1 participant