Skip to content

deno install with import_map.json appears to be broken #15350

@andykais

Description

@andykais

I have made this third party module https://deno.land/x/wallpal. It is a cli script, so I attempted to install it with

deno install -A --import-map=https://deno.land/x/[email protected]/import_map.json https://deno.land/x/[email protected]/wallpal.ts

deno prints this output, then exits with 1.

Download https://deno.land/x/[email protected]/[email protected]/encoding/_yaml/parse.ts
Download https://deno.land/x/[email protected]/[email protected]/encoding/_yaml/schema.ts
Download https://deno.land/x/[email protected]/[email protected]/encoding/_yaml/schema/mod.ts
Download https://deno.land/x/[email protected]/[email protected]/encoding/_yaml/stringify.ts
Download https://deno.land/x/[email protected]/[email protected]/encoding/_yaml/type.ts
Download https://deno.land/x/[email protected]/[email protected]/_util/assert.ts
Download https://deno.land/x/[email protected]/[email protected]/fs/copy.ts
Download https://deno.land/x/[email protected]/[email protected]/fs/empty_dir.ts
Download https://deno.land/x/[email protected]/[email protected]/fs/ensure_dir.ts
Download https://deno.land/x/[email protected]/[email protected]/fs/ensure_file.ts
Download https://deno.land/x/[email protected]/[email protected]/fs/ensure_link.ts
Download https://deno.land/x/[email protected]/[email protected]/fs/ensure_symlink.ts
Download https://deno.land/x/[email protected]/[email protected]/fs/eol.ts
Download https://deno.land/x/[email protected]/[email protected]/fs/exists.ts
Download https://deno.land/x/[email protected]/[email protected]/fs/expand_glob.ts
Download https://deno.land/x/[email protected]/[email protected]/fs/move.ts
Download https://deno.land/x/[email protected]/[email protected]/fs/walk.ts
Download https://deno.land/x/[email protected]/[email protected]/io/buffer.ts
Download https://deno.land/x/[email protected]/[email protected]/io/readers.ts
Download https://deno.land/x/[email protected]/[email protected]/io/streams.ts
Download https://deno.land/x/[email protected]/[email protected]/io/util.ts
Download https://deno.land/x/[email protected]/[email protected]/io/writers.ts
error: Module not found "https://deno.land/x/[email protected]/[email protected]/fs/expand_glob.ts".
    at https://deno.land/[email protected]/fs/mod.ts:12:15

This project has an import map that looks like this:

{
  "imports": {
    "std/fs": "https://deno.land/[email protected]/fs/mod.ts",
    "std/io": "https://deno.land/[email protected]/io/mod.ts",
    "std/flags": "https://deno.land/[email protected]/flags/mod.ts",
    "std/encoding/": "https://deno.land/[email protected]/encoding/",
    "keypress/": "https://deno.land/x/[email protected]/",
    "/": "./",
    "./": "./"
  }
}

and imports that look like

import * as fs from 'std/fs'

It seems that deno is attempting to resolve these imports as if they are local to the wallpal module. These import maps work fine locally, but they fail with deno install, so I am inclined to believe there is a bug.

deno --version

deno 1.24.0 (release, x86_64-unknown-linux-gnu)
v8 10.4.132.20
typescript 4.7.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs investigationrequires further investigation before determining if it is an issue or not

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions