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

deno vendor with importMap fails to resolve modules #14077

Closed
cdaringe opened this issue Mar 22, 2022 · 1 comment
Closed

deno vendor with importMap fails to resolve modules #14077

cdaringe opened this issue Mar 22, 2022 · 1 comment
Assignees
Labels
duplicate a duplicate of another issue

Comments

@cdaringe
Copy link
Contributor

cdaringe commented Mar 22, 2022

Problem

deno run --import-map=vendor/import_map.json mod.ts fails to resolve dependencies after dependencies vendor'd via deno vendor --import_map=....

Error: # error: Relative import path "oak/mod.ts" not prefixed with / or ./ or ../

Discussion

works:

$ deno run --import-map import_map.json  -A --unstable /app/src/bin.ts

doesn't work:

# vendor the deps, using the ~same flags as above
$ deno vendor --import-map=import_map.json /app/src/bin.ts

# run with vendored
$ deno run --import-map=/app/vendor/import_map.json --unstable --allow-env --allow-net /app/src/bin.ts
# yields:
# error: Relative import path "oak/mod.ts" not prefixed with / or ./ or ../

Reproduction

Easy!

  • git clone https://github.com/cdaringe/deno-emit-esm-server.git
  • cd deno-emit-esm-server
  • git checkout b23071be397a2d2e7e7ca53b9df0832de3241bb9
  • (optional) Prove that the server works
    • run it:deno run --import-map=import_map.json --unstable --allow-env --allow-net ./src/bin.ts (no output)
    • access it: curl http://localhost:7777/github/denoland/deno_std/main/uuid/mod.ts (observe JS emitted to stdout)
  • deno vendor --import-map=import_map.json ./src/bin.ts
  • deno run --import-map=vendor/import_map.json --unstable --allow-env --allow-net ./src/bin.ts
    • Observe the module resolution failure
@dsherret
Copy link
Member

dsherret commented Mar 22, 2022

Looks like #13697 -- Basically this is not implemented yet. You will have to manually merge the import maps manually for the time being unfortunately.

@dsherret dsherret added the duplicate a duplicate of another issue label Mar 22, 2022
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