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

latest version not allowed in deno.json and [email protected] is missing __dirname #25928

Open
studiowebux opened this issue Sep 29, 2024 · 0 comments

Comments

@studiowebux
Copy link

studiowebux commented Sep 29, 2024

Version: Deno 2.0.0-rc.7

I have linked 2 unrelated errors I got one after the other.

The first one: I added only because it asks me to report it.
The second one: I was wondering if it is related to Deno 2 or the canvas package itself ?


My project is working without problems on 1.45.x and 1.46.x

First error

using the newest version I get this message when a dependency is using :latest:

RUST_BACKTRACE=full deno run game:start
Task game:start deno run -A --watch src/bin/main.tsx
Watcher Process started.

============================================================
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.7
Args: ["/Users/tgingras/.deno/bin/deno", "run", "-A", "--watch", "src/bin/main.tsx"]

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: latest
stack backtrace:
   0:        0x1058df5d4 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h41035ce174e31160
   1:        0x104a03ecc - core::fmt::write::h7e946826fce7616b
   2:        0x1058b0484 - std::io::Write::write_fmt::he3645adfefb23e4a
   3:        0x1058e1f94 - std::sys_common::backtrace::print::h2efe9ae66fda73dc
   4:        0x1058e18ac - std::panicking::default_hook::{{closure}}::hd27200b4fbd3bf40
   5:        0x1058e14b4 - std::panicking::default_hook::hb8656334461229c8
   6:        0x1048fe724 - deno::setup_panic_hook::{{closure}}::h6ceb83d290cda6ec
   7:        0x1058e2884 - std::panicking::rust_panic_with_hook::h10171cf76e1aed15
   8:        0x1058e2308 - std::panicking::begin_panic_handler::{{closure}}::h9344de43a47cae21
   9:        0x1058e2270 - std::sys_common::backtrace::__rust_end_short_backtrace::h55013ada3ab9c4e8
  10:        0x1058e2264 - _rust_begin_unwind
  11:        0x104a023a0 - core::panicking::panic_fmt::h0b16bb09366e1f01
  12:        0x1053c75fc - deno_semver::VersionReq::matches::h36d73ea695b95652
  13:        0x10482768c - <deno::npm::byonm::ByonmCliNpmResolver as deno::npm::CliNpmResolver>::resolve_pkg_folder_from_deno_module_req::h2c43f0b51cf4b08b
  14:        0x10483b114 - deno::resolver::CliNodeResolver::resolve_req_reference::h1521a137134a892f
  15:        0x10483dc14 - <deno::resolver::CliGraphResolver as deno_graph::source::Resolver>::resolve::h592833e8480ea2db
  16:        0x104cb89c0 - deno_graph::graph::resolve::hef5319272a9924e0
  17:        0x104cedd18 - deno_graph::graph::fill_module_dependencies::ha0e2e4ca7216958a
  18:        0x104cecf30 - deno_graph::graph::parse_js_module_from_module_info::h8f131ada07b9ed11
  19:        0x104ce770c - deno_graph::graph::Builder::visit::h1cb28d567356b67b
  20:        0x104539b0c - deno_graph::graph::Builder::fill::{{closure}}::h6738d5208faf4a2e
  21:        0x104538468 - deno_graph::graph::ModuleGraph::build::{{closure}}::hdd2089c47f8d2d58
  22:        0x10479bd14 - deno::graph_util::ModuleGraphBuilder::build_graph_with_npm_resolution::{{closure}}::hb9e822887aca923c
  23:        0x1048226c0 - deno::module_loader::ModuleLoadPreparer::prepare_module_load::{{closure}}::h886af6e00e0d3e61
  24:        0x10482537c - <deno::module_loader::CliModuleLoader<TGraphContainer> as deno_core::modules::loaders::ModuleLoader>::prepare_load::{{closure}}::hb38a868796dd7400
  25:        0x104747cbc - deno_core::modules::recursive_load::RecursiveModuleLoad::prepare::{{closure}}::h2d4d6dd9dad2d663
  26:        0x1048e4474 - deno::worker::CliMainWorker::execute_main_module_possibly_with_npm::{{closure}}::h17b06675181a8f78
  27:        0x1048e4018 - deno::worker::CliMainWorker::run_for_watcher::{{closure}}::h705aacd25202ca10
  28:        0x1048fd444 - deno::run_subcommand::{{closure}}::{{closure}}::heafc62ef553b994d
  29:        0x1048ee0f0 - deno::spawn_subcommand::{{closure}}::h3504875cd0d4f368
  30:        0x104522834 - <deno_unsync::tokio::task::MaskFutureAsSend<F> as core::future::future::Future>::poll::ha046c6125cf22272
  31:        0x104692b30 - tokio::runtime::task::raw::poll::hafbcd1b4d39d9f4d
  32:        0x1048ffc2c - deno::main::h1d7df0f820ae88d7
  33:        0x1045c29c8 - std::sys_common::backtrace::__rust_begin_short_backtrace::h193e261b6eefe56d
  34:        0x104967e20 - _main

The error above has been fixed by removing the :latest from this dependency in the deno.json file :

"prometheus": "npm:@hono/[email protected]",

Second error:

Was working with 1.45.x and 1.46.x

RUST_BACKTRACE=full deno run game:start
Task game:start deno run -A --watch src/bin/main.tsx
Watcher Process started.
error: Uncaught (in promise) ReferenceError: __dirname is not defined
        Ca = za ? require("path").dirname(Ca)   "/" : __dirname   "/",
                                                      ^
    at Module.<anonymous> (https://deno.land/x/[email protected]/src/lib.js:3784:55)
    at init (https://deno.land/x/[email protected]/src/canvaskit.ts:9:20)
    at init (https://deno.land/x/[email protected]/src/canvas.ts:9:18)
    at https://deno.land/x/[email protected]/mod.ts:3:22
Watcher Process failed. Restarting on file change...

This one I ain't sure what to check, is it related to deno 2 ?

I just tried this package : jsr:@gfx/[email protected] seems to work as a replacement.

Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant