denoland / deno

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

bug: `deno doc --lint yaml/mod.ts` panics #23303

Closed iuioiua closed 6 months ago

iuioiua commented 7 months ago

To reproduce:

  1. Clone the deno_std.
  2. Run deno doc --lint yaml/mod.ts.

CC @dsherret

dsherret commented 7 months ago

Output (please include in the future):

> deno doc --lint yaml/mod.ts
error[private-type-ref]: public type 'ParseOptions' references private type 'LoaderStateOptions'
  --> V:\deno_std\yaml\parse.ts:10:1
   |
10 | export type ParseOptions = LoaderStateOptions;
   | ^
   = hint: make the referenced type public or remove the reference
   |
13 |  * Parses `content` as single YAML document.
   |                      - this is the referenced type

  info: to ensure documentation is complete all types that are exposed in the public API must be public

error[missing-jsdoc]: exported symbol is missing JSDoc documentation
  --> V:\deno_std\yaml\parse.ts:10:1
   |
10 | export type ParseOptions = LoaderStateOptions;
   | ^

============================================================
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: windows x86_64
Version: 1.42.1
Args: ["C:\\Users\\david\\.deno\\bin\\deno.exe", "doc", "--lint", "yaml/mod.ts"]

thread 'main' panicked at C:\Users\runneradmin\.cargo\registry\src\index.crates.io-6f17d22bba15001f\dprint-swc-ext-0.15.1\src\common\text_info.rs:198:7:
The provided position 45758 was greater than the end position 1678.
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
roziscoding commented 6 months ago

I get the same behavior when running it on https://github.com/grammyjs/commands.

Output:

❯ RUST_BACKTRACE=full deno doc --lint src/commands.ts | pbcopy

============================================================
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: 1.42.4
Args: ["/home/roziscoding/.asdf/installs/deno/1.42.4/bin/deno", "doc", "--lint", "src/commands.ts"]

thread 'main' panicked at /home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/dprint-swc-ext-0.15.1/src/common/text_info.rs:198:7:
The provided position 13977 was greater than the end position 5385.
stack backtrace:
   0:     0x5862c62fd626 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h410d4c66be4e37f9
   1:     0x5862c6332460 - core::fmt::write::he40921d4802ce2ac
   2:     0x5862c62f6f0f - std::io::Write::write_fmt::h5de5a4e7037c9b20
   3:     0x5862c62fd404 - std::sys_common::backtrace::print::h11c067a88e3bdb22
   4:     0x5862c62ff177 - std::panicking::default_hook::{{closure}}::h8c832ecb03fde8ea
   5:     0x5862c62feed9 - std::panicking::default_hook::h1633e272b4150cf3
   6:     0x5862c683690e - deno::setup_panic_hook::{{closure}}::hafaa822b297ada52
   7:     0x5862c62ff806 - std::panicking::rust_panic_with_hook::hb164d19c0c1e71d4
   8:     0x5862c62ff552 - std::panicking::begin_panic_handler::{{closure}}::h0369088c533c20e9
   9:     0x5862c62fdb26 - std::sys_common::backtrace::__rust_end_short_backtrace::hc11d910daf35ac2e
  10:     0x5862c62ff2a4 - rust_begin_unwind
  11:     0x5862c632f4f5 - core::panicking::panic_fmt::ha6effc2775a0749c
  12:     0x5862c80484d9 - dprint_swc_ext::common::text_info::SourceTextInfo::assert_pos::h818ec4fe42f52abc
  13:     0x5862c804822e - dprint_swc_ext::common::text_info::SourceTextInfo::line_index::hc4eebc0ee43f4292
  14:     0x5862c7ec0501 - deno_ast::diagnostics::line_number::h2bcaa176a2e82b1a
  15:     0x5862c657da03 - <deno_ast::diagnostics::DiagnosticDisplay<T> as core::fmt::Display>::fmt::h9f6999f3fa8420d5
  16:     0x5862c6332460 - core::fmt::write::he40921d4802ce2ac
  17:     0x5862c6332460 - core::fmt::write::he40921d4802ce2ac
  18:     0x5862c68c51e1 - std::io::Write::write_fmt::he634b257f36815fa
  19:     0x5862c680c488 - deno::util::logger::init::{{closure}}::h0d8fa77159970591
  20:     0x5862c68cafd8 - <env_logger::Logger as log::Log>::log::{{closure}}::hd8817d4e4a840270
  21:     0x5862c68cac22 - <env_logger::Logger as log::Log>::log::hddc49d359be0831c
  22:     0x5862c83071fe - log::__private_api::log_impl::hde636fcfe4aa2bd8
  23:     0x5862c6763b8f - deno::tools::doc::doc::{{closure}}::hbe591c090838183e
  24:     0x5862c6821be8 - deno::spawn_subcommand::{{closure}}::h951442524bf255f0
  25:     0x5862c6593f3e - <deno_unsync::task::MaskFutureAsSend<F> as core::future::future::Future>::poll::h03261c18bc19463e
  26:     0x5862c64b0a2f - tokio::runtime::task::raw::poll::he218cbaa603bf46e
  27:     0x5862c6838589 - deno::main::h03f40d987eda8439
  28:     0x5862c63b4d8c - std::sys_common::backtrace::__rust_begin_short_backtrace::h2a66097fae07c83e
  29:     0x5862c63bba9e - std::rt::lang_start::{{closure}}::h274bf2e33bc76394
  30:     0x5862c62ea8d1 - std::rt::lang_start_internal::h4d236095b69a230b
  31:     0x5862c68c4e85 - main
  32:     0x741d63e6ecd0 - <unknown>
  33:     0x741d63e6ed8a - __libc_start_main
  34:     0x5862c4ed3029 - _start
  35:                0x0 - <unknown>