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

importmap ignored by deno install #17834

Closed
thomas3577 opened this issue Feb 20, 2023 · 1 comment
Closed

importmap ignored by deno install #17834

thomas3577 opened this issue Feb 20, 2023 · 1 comment
Labels
duplicate a duplicate of another issue

Comments

@thomas3577
Copy link

When I use importMap, my code does not work as executable (deno install).

Tested with Deno v1.30.3.

Minimal reproducible example:

deno.json:

{
  ...
  "imports": {
    "std/": "https://deno.land/[email protected]/"
  },
  ...
}

my-cli.ts

import * as log from 'std/log/mod.ts';

log.info('Hello world!')

Install & run:

deno install -A ./my-cli.ts

my-cli <--- This throws the error

Error output:

error: Relative import path "std/log/mod.ts" not prefixed with / or ./ or ../
    at file:///C:/temp/app.ts:1:22

The same problem when I use an import map file (import_map.json). Only if I use absolute paths, it also works with deno install.

@dsherret
Copy link
Member

dsherret commented Feb 21, 2023

This is a duplicate of #17572. See #17572 (comment) and I opened #17855

To work around this, you will need to explicitly specify the configuration file via a --config flag.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate a duplicate of another issue
Projects
None yet
Development

No branches or pull requests

2 participants