Skip to content

Worker thread panics because flags.js is missing #420

@jayvdb

Description

@jayvdb

Describe the bug

rustyscript builds deno_runtime with exclude_runtime_main_js, so flags.js (which 90_deno_ns.js imports for unstableIds) is not registered. Without it, JsRuntime init in the worker thread panics:

thread 'worker-1' (229740) panicked at /Users/jayvdb/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/deno_core-0.400.0/runtime/jsruntime.rs:653:9:
Failed to initialize a JsRuntime: Specifier "ext:deno_features/flags.js" was not passed as an extension module and was not included in the snapshot.
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

thread 'worker-1' (229740) panicked at /Users/jayvdb/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/deno_runtime-0.255.0/tokio_util.rs:114:36:
called `Result::unwrap()` on an `Err` value: JoinError::Panic(Id(6), "Failed to initialize a JsRuntime: Specifier \"ext:deno_features/flags.js\" was not passed as an extension module and was not included in the snapshot.", ...)
Error: Uncaught (in promise) Error: Worker thread terminated unexpectedly before initialization completed
    at ext:runtime/11_workers.js:54:10

To Reproduce

Expected behavior

Screenshots

Desktop (please complete the following information):

  • OS: macos
  • Browser:
  • Version: 0.12.3

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions