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

1.1.1: Compiler API: thread "main" panic on minimal import statement #6423

Closed
SRNV opened this issue Jun 22, 2020 · 7 comments · Fixed by #6758
Closed

1.1.1: Compiler API: thread "main" panic on minimal import statement #6423

SRNV opened this issue Jun 22, 2020 · 7 comments · Fixed by #6758
Assignees
Labels
bug Something isn't working correctly cli related to cli/ dir

Comments

@SRNV
Copy link

SRNV commented Jun 22, 2020

version: 1.1.1
cmd: sudo deno run -c tsconfig.json --unstable -A examples/tests/modules/build.ts
code:

const [, scriptProd] = await Deno.compile("index.ts", {
        "index.ts": `import test from '/test.js'`,
        "test.js": 'export default 10;',
      }, {
        module: "esnext",
        target: "esnext",
        resolveJsonModule: false,
        experimentalDecorators: true,
        allowUnreachableCode: false,
        jsx: "preserve",
        jsxFactory: "Ogone.r(",
        inlineSourceMap: false,
        inlineSources: false,
        alwaysStrict: false,
        sourceMap: false,
        strictFunctionTypes: true,
        lib: ["dom", "esnext"],
      });

log:

thread 'main' panicked at 'Can't downcast ErrBox(JSError(JSError { message: "Uncaught AssertionError: Assertion failed.", source_line: None, script_resource_name: Some("$deno$/util.ts"), line_number: Some(35), start_column: Some(10), end_column: Some(11), frames: [JSStackFrame { type_name: Some("Object"), function_name: Some("assert"), method_name: Some("assert"), file_name: Some("$deno$/util.ts"), line_number: Some(35), column_number: Some(11), eval_origin: None, is_top_level: None, is_eval: false, is_native: false, is_constructor: false, is_async: false, is_promise_all: false, promise_index: Some(11) }, JSStackFrame { type_name: None, function_name: Some("buildLocalSourceFileCache"), method_name: None, file_name: Some("$deno$/compiler.ts"), line_number: Some(551), column_number: Some(7), eval_origin: None, is_top_level: None, is_eval: false, is_native: false, is_constructor: false, is_async: false, is_promise_all: false, promise_index: Some(7) }, JSStackFrame { type_name: None, function_name: Some("runtimeCompile"), method_name: None, file_name: Some("$deno$/compiler.ts"), line_number: Some(1335), column_number: Some(3), eval_origin: None, is_top_level: None, is_eval: false, is_native: false, is_constructor: false, is_async: false, is_promise_all: false, promise_index: Some(3) }, JSStackFrame { type_name: Some("global"), function_name: Some("tsCompilerOnMessage"), method_name: Some("onmessage"), file_name: Some("$deno$/compiler.ts"), line_number: Some(1505), column_number: Some(22), eval_origin: None, is_top_level: None, is_eval: false, is_native: false, is_constructor: false, is_async: false, is_promise_all: false, promise_index: Some(22) }, JSStackFrame { type_name: None, function_name: Some("workerMessageRecvCallback"), method_name: None, file_name: Some("$deno$/runtime_worker.ts"), line_number: Some(72), column_number: Some(33), eval_origin: None, is_top_level: None, is_eval: false, is_native: false, is_constructor: false, is_async: false, is_promise_all: false, promise_index: Some(33) }, JSStackFrame { type_name: Some("global"), function_name: None, method_name: None, file_name: Some("file:///home/rudy/Documents/Perso/Ogone/__anonymous__"), line_number: Some(1), column_number: Some(1), eval_origin: None, is_top_level: None, is_eval: false, is_native: false, is_constructor: false, is_async: false, is_promise_all: false, promise_index: Some(1) }], formatted_frames: ["Object.assert ($deno$/util.ts:35:11)", "buildLocalSourceFileCache ($deno$/compiler.ts:551:7)", "runtimeCompile ($deno$/compiler.ts:1335:3)", "tsCompilerOnMessage ($deno$/compiler.ts:1505:22)", "workerMessageRecvCallback ($deno$/runtime_worker.ts:72:33)", "file:///home/rudy/Documents/Perso/Ogone/__anonymous__:1:1"] })) to OpError', cli/op_error.rs:422:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

stack backtrace:


   0:     0x55fa63a20f34 - backtrace::backtrace::libunwind::trace::hc1c4a1d8ad423b97
                               at /cargo/registry/src/git.luolix.top-1ecc6299db9ec823/backtrace-0.3.46/src/backtrace/libunwind.rs:86
   1:     0x55fa63a20f34 - backtrace::backtrace::trace_unsynchronized::h82274781060cb056
                               at /cargo/registry/src/git.luolix.top-1ecc6299db9ec823/backtrace-0.3.46/src/backtrace/mod.rs:66
   2:     0x55fa63a20f34 - std::sys_common::backtrace::_print_fmt::h2a45d89b653a4da8
                               at src/libstd/sys_common/backtrace.rs:78
   3:     0x55fa63a20f34 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h41a0a93ab85e6aa1
                               at src/libstd/sys_common/backtrace.rs:59
   4:     0x55fa63a5178c - core::fmt::write::hdaea18585065a96d
                               at src/libcore/fmt/mod.rs:1069
   5:     0x55fa63a17fc3 - std::io::Write::write_fmt::h0cea70c809005252
                               at src/libstd/io/mod.rs:1504
   6:     0x55fa63a23dc5 - std::sys_common::backtrace::_print::hd95f9978cc145ca4
                               at src/libstd/sys_common/backtrace.rs:62
   7:     0x55fa63a23dc5 - std::sys_common::backtrace::print::hfb25ca2291be47d0
                               at src/libstd/sys_common/backtrace.rs:49
   8:     0x55fa63a23dc5 - std::panicking::default_hook::{{closure}}::h44f76cee5dc8591c
                               at src/libstd/panicking.rs:198
   9:     0x55fa63a23b02 - std::panicking::default_hook::h198e1a712910f1e6
                               at src/libstd/panicking.rs:218
  10:     0x55fa63a24422 - std::panicking::rust_panic_with_hook::hc0b4730bb8013f9d
                               at src/libstd/panicking.rs:511
  11:     0x55fa63a2400b - rust_begin_unwind
                               at src/libstd/panicking.rs:419
  12:     0x55fa63a23f7b - std::panicking::begin_panic_fmt::h3693eb684a4f728c
                               at src/libstd/panicking.rs:373
  13:     0x55fa625a30f8 - <deno::op_error::OpError as core::convert::From<deno_core::errors::ErrBox>>::from::{{closure}}::hc13a5b472f433617
  14:     0x55fa625a2f1e - <deno::op_error::OpError as core::convert::From<deno_core::errors::ErrBox>>::from::hda6b4d7c5e8e4f6f
  15:     0x55fa624e00ca - <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll::hfbb3131637005bf7
  16:     0x55fa624bcee2 - <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll::h6d0f99e877b0180a
  17:     0x55fa626d032c - <futures_util::future::future::map::Map<Fut,F> as core::future::future::Future>::poll::ha09ffbad1a36a2c4
  18:     0x55fa6269e89f - <futures_util::future::future::flatten::Flatten<Fut,<Fut as core::future::future::Future>::Output> as core::future::future::Future>::poll::he8e455d297c74124
  19:     0x55fa626d92cf - <futures_util::future::future::map::Map<Fut,F> as core::future::future::Future>::poll::hdcbd37db28cdfa9e
  20:     0x55fa62e9bb84 - <futures_util::future::future::map::Map<Fut,F> as core::future::future::Future>::poll::hddb5331b9dea9e64
  21:     0x55fa62e7db59 - <futures_util::future::future::Map<Fut,F> as core::future::future::Future>::poll::hf8020d97b7bae34d
  22:     0x55fa62e9ffa1 - futures_util::stream::stream::StreamExt::poll_next_unpin::h885734c4ac44edb6
  23:     0x55fa62e80ab3 - <deno_core::core_isolate::CoreIsolate as core::future::future::Future>::poll::h6970f86c79d53070
  24:     0x55fa62e7a161 - <deno_core::es_isolate::EsIsolate as core::future::future::Future>::poll::h03c37420632a3e55
  25:     0x55fa624d9283 - <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll::hd6aa575daf844bff
  26:     0x55fa626e1520 - std::thread::local::LocalKey<T>::with::hbae5758cbbb986d7
  27:     0x55fa624abb87 - tokio::macros::scoped_tls::ScopedKey<T>::set::h63f182d019a8aea3
  28:     0x55fa6258cf6d - tokio::runtime::basic_scheduler::BasicScheduler<P>::block_on::hbae780f60b87f7a1
  29:     0x55fa62525d8d - tokio::runtime::context::enter::hf9e40c486f33bdf5
  30:     0x55fa62632654 - deno::tokio_util::run_basic::hfd509858047a7c5f
  31:     0x55fa62569f14 - deno::main::h8160d79eba3150cb
  32:     0x55fa626dfae3 - std::rt::lang_start::{{closure}}::h96e2216cfd68cb58
  33:     0x55fa63a24868 - std::rt::lang_start_internal::{{closure}}::h7a212202ff76034b
                               at src/libstd/rt.rs:52
  34:     0x55fa63a24868 - std::panicking::try::do_call::h6d214a73427d759b
                               at src/libstd/panicking.rs:331
  35:     0x55fa63a24868 - std::panicking::try::hc078f0e11721d1cb
                               at src/libstd/panicking.rs:274
  36:     0x55fa63a24868 - std::panic::catch_unwind::hb31c05be30625612
                               at src/libstd/panic.rs:394
  37:     0x55fa63a24868 - std::rt::lang_start_internal::hcf7fb98a775d5af0
                               at src/libstd/rt.rs:51
  38:     0x55fa6256b122 - main
  39:     0x7ff474951b97 - __libc_start_main
  40:     0x55fa62295279 - _start
  41:                0x0 - <unknown>

issue is not reproduced when erasing any import statement

@kitsonk
Copy link
Contributor

kitsonk commented Jun 22, 2020

While it shouldn't panic like that, when passing sources, you have to use the literal module name you supply, so you have to: import test from 'test.js'.

@SRNV
Copy link
Author

SRNV commented Jun 22, 2020

Tested it also with an url
But same panic result
What is the behavior expected with an url

@bartlomieju bartlomieju added bug Something isn't working correctly cli related to cli/ dir labels Jun 22, 2020
@bartlomieju bartlomieju self-assigned this Jun 22, 2020
@ry
Copy link
Member

ry commented Jun 22, 2020

I believe this is the same issue in #6272

Nevermind - that one seems to be fixed.

@SRNV
Copy link
Author

SRNV commented Jun 30, 2020

@bartlomieju any news on this one ? thanks

@SRNV
Copy link
Author

SRNV commented Jul 17, 2020

@bartlomieju got a release date for this fix ?

@bartlomieju
Copy link
Member

@SRNV most likely next week with 1.2.1

@SRNV
Copy link
Author

SRNV commented Jul 17, 2020

ok thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working correctly cli related to cli/ dir
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants