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: deno install panics with package.json + @latest #24932

Closed
marvinhagemeister opened this issue Aug 7, 2024 · 1 comment · Fixed by #24968
Closed

Bug: deno install panics with package.json + @latest #24932

marvinhagemeister opened this issue Aug 7, 2024 · 1 comment · Fixed by #24968
Labels
bug Something isn't working correctly install

Comments

@marvinhagemeister
Copy link
Contributor

marvinhagemeister commented Aug 7, 2024

This error only occurs when a package.json is used. It doesn't occur with deno.json.

Steps to reproduce

  1. Create a package.json with these contents:
{
  "dependencies": {
    "foo": "npm:preact-render-to-string@latest"
  }
}
  1. Run DENO_FUTURE=1 deno install --allow-scripts

Output:

============================================================
Deno has panicked. This is a bug in Deno. Please report this
at https://github.com/denoland/deno/issues/new.
If you can reliably reproduce this panic, include the
reproduction steps and re-run with the RUST_BACKTRACE=1 env
var set and include the backtrace in your report.

Platform: macos aarch64
Version: 1.45.5
Args: ["deno", "install", "--allow-scripts"]

thread 'main' panicked at /Users/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/deno_semver-0.5.7/src/lib.rs:275:32:
programming error: cannot use matches with a tag: latest
stack backtrace:
   0: _rust_begin_unwind
   1: core::panicking::panic_fmt
   2: deno_semver::VersionReq::matches
   3: deno_npm::resolution::snapshot::NpmResolutionSnapshot::resolve_best_package_id
   4: deno::npm::managed::resolvers::local::sync_resolution_with_fs::{{closure}}
   5: <deno::npm::managed::resolvers::local::LocalNpmPackageResolver as deno::npm::managed::resolvers::common::NpmPackageFsResolver>::cache_packages::{{closure}}
   6: deno::npm::managed::ManagedCliNpmResolver::cache_packages::{{closure}}
   7: deno::npm::managed::ManagedCliNpmResolver::add_package_reqs_raw::{{closure}}
   8: deno::npm::managed::ManagedCliNpmResolver::add_package_reqs::{{closure}}
   9: deno::npm::managed::ManagedCliNpmResolver::ensure_top_level_package_json_install::{{closure}}
  10: deno::module_loader::load_top_level_deps::{{closure}}
  11: deno::spawn_subcommand::{{closure}}
  12: <deno_unsync::tokio::task::MaskFutureAsSend<F> as core::future::future::Future>::poll
  13: tokio::runtime::task::raw::poll
  14: deno::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

Version: Deno 1.45.5

@marvinhagemeister marvinhagemeister added bug Something isn't working correctly install labels Aug 7, 2024
@marvinhagemeister marvinhagemeister changed the title Bug: Running deno install panics Bug: Running deno install panics with package.json and package@latest tag Aug 7, 2024
@marvinhagemeister marvinhagemeister changed the title Bug: Running deno install panics with package.json and package@latest tag Bug: Running deno install panics with package.json + @latest Aug 7, 2024
@marvinhagemeister marvinhagemeister changed the title Bug: Running deno install panics with package.json + @latest Bug: deno install panics with package.json + @latest Aug 7, 2024
@dsherret
Copy link
Member

dsherret commented Aug 8, 2024

One day we'll remove the possibility of a panic using that (denoland/deno_semver#25)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working correctly install
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants