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

Bug: Unable to override importMap config with --import-map flag in deno install #27734

Closed
abhi-parate-st3 opened this issue Jan 20, 2025 · 1 comment · Fixed by #27744
Closed
Labels
config Related to configuring Deno via deno.json/deno.jsoc regression

Comments

@abhi-parate-st3
Copy link

Bug Report: Import Map Resolution Issue in deno install

Version: Deno 2.1.5, 2.1.6

Description

Since Deno 2.1.5, there appears to be a breaking change in how deno install handles import maps when specified both in the configuration file and via command line flag.

Current Behavior

When using deno install with both a config file containing an importMap field and the --import-map flag, Deno attempts to read the import map from the local path specified in the config file, resulting in an error.

Error message:

error: Unable to read import map at '/Users/staytuned/.deno/bin/import_map.json'

Previous Behavior

In earlier versions, Deno would ignore the importMap field in the config file when the --import-map flag was present, showing a warning:

Warning the configuration file "file:///../deno.json" contains an entry for "importMap" that is being ignored.

Steps to Reproduce

  1. Create a local deno.json with:
{
  "importMap": "./import_map.json"
}
  1. Run the install command:
deno install --reload -A -f --global \
  --config ./deno.json \
  --import-map https://remote-location/import_map.json \
  https://remote-location/main.ts

Expected Behavior

The --import-map flag should take precedence over the config file's importMap field, as it did in previous versions.

Additional Context

This issue is related to #26110 where remote URLs in config files are not supported. The current behavior makes it difficult to install CLI tools from remote locations that require import maps.

@abhi-parate-st3
Copy link
Author

Thank you to the Deno team for the incredibly quick response and fix! Really appreciate the fast turnaround time - it's great to see such responsive maintenance of the project. This kind of quick service helps the whole community. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
config Related to configuring Deno via deno.json/deno.jsoc regression
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants