denoland / deno

A modern runtime for JavaScript and TypeScript.
https://deno.com
MIT License
94.55k stars 5.25k forks source link

Deno install - Panic on Windows #25861

Open zZHorizonZz opened 1 week ago

zZHorizonZz commented 1 week ago

Platform: windows x86_64 Version: 2.0.0-rc.5 Args: ["C:\Users\daniel\.deno\bin\deno.exe", "install"]

thread 'main' panicked at C:\Users\runneradmin.cargo\registry\src\index.crates.io-6f17d22bba15001f\deno_semver-0.5.13\src/lib.rs:284:32: programming error: cannot use matches with a tag: beta stack backtrace: 0: 0x7ff7da0218ad - onig_get_string_end_by_callout_args 1: 0x7ff7d881cdd9 - onig_get_start_by_callout_args 2: 0x7ff7d9ffe861 - onig_get_string_end_by_callout_args 3: 0x7ff7da025766 - onig_get_string_end_by_callout_args 4: 0x7ff7da02502a - onig_get_string_end_by_callout_args 5: 0x7ff7da024be1 - onig_get_string_end_by_callout_args 6: 0x7ff7d864eead - onig_get_capture_tree 7: 0x7ff7da025b07 - onig_get_string_end_by_callout_args 8: 0x7ff7da0259a7 - onig_get_string_end_by_callout_args 9: 0x7ff7da0258ef - onig_get_string_end_by_callout_args 10: 0x7ff7da0258d8 - onig_get_string_end_by_callout_args 11: 0x7ff7dbae68a4 - onig_unicode_define_user_property 12: 0x7ff7d9742b3d - onig_builtin_fail 13: 0x7ff7d8492da2 - onig_get_capture_tree 14: 0x7ff7d86e6ba7 - node_api_get_module_file_name 15: 0x7ff7d84a6010 - onig_get_capture_tree 16: 0x7ff7d84a5234 - onig_get_capture_tree 17: 0x7ff7d84a4368 - onig_get_capture_tree 18: 0x7ff7d84a64c1 - onig_get_capture_tree 19: 0x7ff7d855ea03 - onig_get_capture_tree 20: 0x7ff7d8624f4d - onig_get_capture_tree 21: 0x7ff7d8017c8d - onig_get_regex_by_callout_args 22: 0x7ff7d871c305 - node_api_get_module_file_name 23: 0x7ff7d81518f0 - onig_get_regex_by_callout_args 24: 0x7ff7d8651432 - onig_get_capture_tree 25: 0x7ff7d7fd4cfc - onig_get_regex_by_callout_args 26: 0x7ff7d871c3e6 - node_api_get_module_file_name 27: 0x7ff7dba88fdc - onig_unicode_define_user_property 28: 0x7ffdfcc2dbe7 - BaseThreadInitThunk 29: 0x7ffdfd4a5a6c - RtlUserThreadStart

yazan-abdalrahman commented 1 week ago

@satyarohith @zZHorizonZz @marvinhagemeister @bartlomieju I tried reproducing the issue but was unable to

image

yazan-abdalrahman commented 1 week ago

https://github.com/user-attachments/assets/af004fe7-4df3-4961-9cd9-1e5becf53a8e

zZHorizonZz commented 1 week ago

Unfortunately, this is occurring in our monorepo production application where we wanted to give Deno a try. However, since it's not an application I can share, I don't think I will be of much help. This error went away when I changed the version of next-auth from "beta" to 5.0.0-beta.21, but when I tried the same thing with a default Next.js app and tried installing next-auth with the "beta" version, it worked. So I think there might be something else at play as well.

There are some other errors now, but those are more related to the fact that we are using Turborepo, and Deno is not currently supported by it.

zZHorizonZz commented 1 week ago

I have created a reproducer and will upload it shortly. Basically, it comes down to this: If next-auth with the beta version is in the main package.json, it works and resolves. However, if the next-auth beta version is in another module/workspace, it throws this error.

zZHorizonZz commented 1 week ago

You should be able to clone it and just try running deno install https://github.com/zZHorizonZz/deno-bug-report-01

marvinhagemeister commented 6 days ago

Can confirm, the repro panics for me on macOS as well. It looks like the version tag is not resolved to an actual version. Here is the stack trace on macOS:

============================================================
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: 2.0.0-rc.5+6c26c1e
Args: ["deno", "install"]

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

@lucacasonato @marvinhagemeister @dsherret @zZHorizonZz Please check my solution. I updated the version matching mechanism to properly handle pre-release tags, avoiding panics caused by the use of'matches' with a tag.

And I put "warn" if it is valid or it should be further upstream.

image