VienDinhCom / supermemo

🧑‍🎓 A JavaScript/TypeScript implementation of the SuperMemo 2 (SM2) algorithm for spaced based repetition flashcards.
https://npm.im/supermemo
MIT License
292 stars 25 forks source link

It doesn't work with Deno #4

Closed kyanny closed 2 years ago

kyanny commented 2 years ago

Hi, thank you for making it publicly available! I tried to use it with Deno, but even only import doesn't work. Am I missing something?

$ deno -V
deno 1.16.2

$ cat index.ts
import { supermemo, SuperMemoItem, SuperMemoGrade } from 'https://deno.land/x/supermemo/mod.ts';

$ deno run -A index.ts
Check file:///Users/kyanny/workspace/sm2/index.ts
thread 'main' panicked at 'internal error: entered unreachable code: unexpected missing emit: https://deno.land/x/supermemo@2.0.17/mod.ts', cli/proc_state.rs:544:15
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

$ RUST_BACKTRACE=full deno run -A index.ts
Check file:///Users/kyanny/workspace/sm2/index.ts
thread 'main' panicked at 'internal error: entered unreachable code: unexpected missing emit: https://deno.land/x/supermemo@2.0.17/mod.ts', cli/proc_state.rs:544:15
stack backtrace:
   0:        0x10ba63d3f - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hf1ee81583766da09
   1:        0x10b3299fb - core::fmt::write::h8dc218a6eb2426a8
   2:        0x10ba6221a - std::io::Write::write_fmt::heef3e26d448f8c80
   3:        0x10ba62e95 - std::panicking::default_hook::{{closure}}::h4b7de73863cf8582
   4:        0x10ba625f7 - std::panicking::default_hook::h778da672ce56a579
   5:        0x10b2e5106 - deno::setup_exit_process_panic_hook::{{closure}}::hfe9a9204138a8142
   6:        0x10ba620c9 - std::panicking::rust_panic_with_hook::ha5146542f697c8af
   7:        0x10ba830ea - std::panicking::begin_panic_handler::{{closure}}::hd8bf1442c82bf304
   8:        0x10ba83069 - std::sys_common::backtrace::__rust_end_short_backtrace::h73a3d0f5ab35b08b
   9:        0x10ba83025 - _rust_begin_unwind
  10:        0x10cc46f5f - core::panicking::panic_fmt::h16f19dd104182e80
  11:        0x10b09de07 - deno::proc_state::ProcState::prepare_module_load::{{closure}}::h7ff3d5c5a5f7f040
  12:        0x10b09b6be - <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll::h95f4f81560e11b4e
  13:        0x10b09b4ad - <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll::hba28f970eba75693
  14:        0x10afb5426 - <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll::h011315fb8be13289
  15:        0x10afb41a9 - <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll::h1d99aa03600e7c07
  16:        0x10b0c1591 - <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll::hac80c5777a31e8a2
  17:        0x10b0bef04 - deno::run_command::{{closure}}::h26541ce94df71d31
  18:        0x10b0bdb61 - <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll::h95b64f207b752c8f
  19:        0x10af8b2e7 - <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll::hcd0e8c40af4c0e1c
  20:        0x10af7c929 - deno::main::heb40db0691ea69e2
  21:        0x10af7824c - std::sys_common::backtrace::__rust_begin_short_backtrace::h88e6039fee8e0e1b
  22:        0x10af784a0 - _main
VienDinhCom commented 2 years ago

Hi @kyanny!

It works for me with Deno 1.16.4. Please try again!