Skip to content

Deno is panicking with programming error: cannot use matches with a tag: #34

@nberlette

Description

@nberlette

I posted this here rather than the main repo after seeing indicators in the backtrace that it was happening in the deno_semver crate.

I'm running into a persistent panic with the LSP and CLI in a monorepo project. This is causing the language server to be completely unusable, as it just repeatedly crashes and ultimately gives up altogether.

The error message is very cryptic and uninformative, however, and doesn't specify which package or file this is occuring in. All it states is programming error: cannot use matches with a tag:.

This all started after I moved a directory in VSCode, so I'm thinking it broke some imports somewhere along the way. Unfortunately this is in a project with several thousand files so I have my work cut out for me trying to track it down... I'm spending my afternoon checking file by file trying to track down a specifier syntax issue that might be causing it.

Any suggestions are very much appreciated. Thanks.

Oh, here's the backtrace:

============================================================
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: linux x86_64
Version: 2.0.0-rc.2+315baeb
Args: ["/usr/local/bin/deno", "lsp"]

thread 'main' panicked at /home/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: 
stack backtrace:
   0:     0x5fb919aaa6d5 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hd736fd5964392270
   1:     0x5fb919add0bb - core::fmt::write::hc6043626647b98ea
   2:     0x5fb919aa471f - std::io::Write::write_fmt::h0d24b3e0473045db
   3:     0x5fb919aaa4ae - std::sys_common::backtrace::print::h45eb8174d25a1e76
   4:     0x5fb919aabf19 - std::panicking::default_hook::{{closure}}::haf3f0170eb4f3b53
   5:     0x5fb919aabcba - std::panicking::default_hook::hb5d3b27aa9f6dcda
   6:     0x5fb91a0dab56 - deno::setup_panic_hook::{{closure}}::h3237b3de083c825a
   7:     0x5fb919aac58b - std::panicking::rust_panic_with_hook::h6b49d59f86ee588c
   8:     0x5fb919aac304 - std::panicking::begin_panic_handler::{{closure}}::hd4c2f7ed79b82b70
   9:     0x5fb919aaab99 - std::sys_common::backtrace::__rust_end_short_backtrace::h2946d6d32d7ea1ad
  10:     0x5fb919aac037 - rust_begin_unwind
  11:     0x5fb919ad9fd3 - core::panicking::panic_fmt::ha02418e5cd774672
  12:     0x5fb91be11747 - deno_semver::VersionReq::matches::h5f21d86ad500b707
  13:     0x5fb91bd646d6 - deno_config::workspace::resolver::WorkspaceResolver::maybe_resolve_specifier_to_workspace_jsr_pkg::ha96f3f7315503564
  14:     0x5fb91bd63e80 - deno_config::workspace::resolver::WorkspaceResolver::resolve::h359ed27c63364e90
  15:     0x5fb919fd1dc3 - <deno::resolver::CliGraphResolver as deno_graph::source::Resolver>::resolve::h6be29659591a893d
  16:     0x5fb91b8f224a - deno_graph::graph::resolve::h2a06e986c6faf615
  17:     0x5fb91b8f5dbb - deno_graph::graph::fill_module_dependencies::h0d2f6d5d0f0f4e16
  18:     0x5fb91b8f4dd4 - deno_graph::graph::parse_js_module_from_module_info::he3483b46ba6d4a9e
  19:     0x5fb91b92b314 - deno_graph::parse_module_from_ast::hd4153ab837458cf0
  20:     0x5fb919f1063e - deno::lsp::documents::analyze_module::ha78dd9083200ff8a
  21:     0x5fb919f104a8 - deno::lsp::documents::parse_and_analyze_module::h45ca056ad65b73b6
  22:     0x5fb919f0cb83 - deno::lsp::documents::Document::new::h5e0afae00d343d80
  23:     0x5fb919f0e9e5 - deno::lsp::documents::FileSystemDocuments::refresh_document::hfea0c3a91c658922
  24:     0x5fb919f2ab8b - deno::lsp::language_server::Inner::refresh_documents_config::{{closure}}::h55949ef63a5d6bc5
  25:     0x5fb919f67de9 - deno::lsp::language_server::Inner::initialized::{{closure}}::he344b926a6bb07ee
  26:     0x5fb91a0f2393 - <deno::lsp::language_server::LanguageServer as deno_tower_lsp::LanguageServer>::initialized::{{closure}}::ha1b0a82ccf9f5b37
  27:     0x5fb919b5f8f0 - deno_tower_lsp::jsonrpc::router::Router<S,E>::method::{{closure}}::{{closure}}::{{closure}}::h292e7e391d2eb019
  28:     0x5fb919e40b17 - <futures_util::future::future::Map<Fut,F> as core::future::future::Future>::poll::hb18bc7be64799f41
  29:     0x5fb919d74f42 - <core::pin::Pin<P> as core::future::future::Future>::poll::hfc854d0000d7fd15
  30:     0x5fb919d74f42 - <core::pin::Pin<P> as core::future::future::Future>::poll::hfc854d0000d7fd15
  31:     0x5fb919b5123c - <deno_tower_lsp::service::LspService<S> as tower_service::Service<deno_tower_lsp::jsonrpc::request::Request>>::call::{{closure}}::h62f06b5582d41ad3
  32:     0x5fb919b7a496 - deno_tower_lsp::transport::Server<I,O,L>::serve::{{closure}}::hc05f4f00e9f950a4
  33:     0x5fb91a0d410c - deno::spawn_subcommand::{{closure}}::hefc8970e6a77d0c2
  34:     0x5fb919af929b - <deno_unsync::tokio::task::MaskFutureAsSend<F> as core::future::future::Future>::poll::hb65a54ec1ff3e7ad
  35:     0x5fb919d27d65 - tokio::runtime::task::raw::poll::hb6276fdedbe3257e
  36:     0x5fb91a0dc78d - deno::main::he16584fcc5954e46
  37:     0x5fb919be5d4c - std::sys_common::backtrace::__rust_begin_short_backtrace::h0e5f3c6e54197981
  38:     0x5fb919bf235d - std::rt::lang_start::{{closure}}::hf297db38d0dfe9fe
  39:     0x5fb919a9869d - std::rt::lang_start_internal::hcee5ed89fc25829a
  40:     0x5fb91a172b55 - main
  41:     0x75c224237d7a - __libc_start_main
  42:     0x5fb918439029 - _start
  43:                0x0 - <unknown>
[Error - 9:17:15 PM] The Deno Language Server server crashed 5 times in the last 3 minutes. The server will not be restarted. See the output for more information.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions