<p dir="auto">Working on a relatively small TS web app project (roughly 10 source files), and got the following error after creating a file and typing some code:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Unable to send result to client.
Unable to get completion info from TypeScript: Error: Debug Failure. False expression.
    at getCompletionEntryCodeActionsAndSourceDisplay (deno:cli/tsc/00_typescript.js:133230:22)
    at Object.getCompletionEntryDetails (deno:cli/tsc/00_typescript.js:133168:30)
    at Object.getCompletionEntryDetails (deno:cli/tsc/00_typescript.js:165282:35)
    at serverRequest (deno:cli/tsc/99_main_compiler.js:717:27)
    at [deno:cli\lsp\tsc.rs:3300:27]:1:12
[Error - 10:53:17 PM] Request completionItem/resolve failed.
  Message: Internal error
  Code: -32603 

============================================================
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.23.4
Args: [&quot;C:\\ProgramData\\chocolatey\\lib\\deno\\deno.exe&quot;, &quot;lsp&quot;]

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Error(&quot;invalid value: 3, expected one of: 0, 1, 2, 4, 8, 16, 32&quot;, line: 0, column: 0)', cli\lsp\tsc.rs:153:54
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
[Error - 10:53:27 PM] The Deno Language Server server crashed 5 times in the last 3 minutes. The server will not be restarted. See the output for more information."><pre class="notranslate"><code class="notranslate">Unable to send result to client.
Unable to get completion info from TypeScript: Error: Debug Failure. False expression.
    at getCompletionEntryCodeActionsAndSourceDisplay (deno:cli/tsc/00_typescript.js:133230:22)
    at Object.getCompletionEntryDetails (deno:cli/tsc/00_typescript.js:133168:30)
    at Object.getCompletionEntryDetails (deno:cli/tsc/00_typescript.js:165282:35)
    at serverRequest (deno:cli/tsc/99_main_compiler.js:717:27)
    at [deno:cli\lsp\tsc.rs:3300:27]:1:12
[Error - 10:53:17 PM] Request completionItem/resolve failed.
  Message: Internal error
  Code: -32603 

============================================================
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.23.4
Args: ["C:\\ProgramData\\chocolatey\\lib\\deno\\deno.exe", "lsp"]

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Error("invalid value: 3, expected one of: 0, 1, 2, 4, 8, 16, 32", line: 0, column: 0)', cli\lsp\tsc.rs:153:54
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
[Error - 10:53:27 PM] The Deno Language Server server crashed 5 times in the last 3 minutes. The server will not be restarted. See the output for more information.
</code></pre></div>
<p dir="auto">My .vscode/settings.json file just has the bare "deno.enable" set to <code class="notranslate">true</code>.<br>
My Deno extension version is v3.13.1</p>
<p dir="auto">Let me know if there's any more info you'd like me to provide.</p>
<h2 dir="auto">HMR</h2>
<p dir="auto">A thing missing with Deno, is the possibility to implement hot module reloading. HMR is widely use in JS development but right now is not really possible to implement it properly with Deno. Would be great to have something like:</p>
<ul dir="auto">
<li><code class="notranslate">Deno.hotModuleReload('./your_module.ts')</code></li>
<li>or something to clear the module cache <code class="notranslate">Deno.clearCacheImport('./your_module.ts')</code></li>
</ul>
<p dir="auto">I started to try to implement the second solution, because it sound easier to me, but since I never develop with Rust before this weekend, it is not easy :p <a href="https://github.com/apiel/deno/pull/1/files">https://github.com/apiel/deno/pull/1/files</a> This still work in progress, I need to find a way to access the modules from ops <code class="notranslate">op_clear_cache_import</code>. (and of course need to unit test and clean up the code) By the way, I am scared that this proposal do not get accepted by the Deno team, anyhow I will still give a try.</p>
<p dir="auto">Another option, would be to give us the possibility to provide our own module loader, but this would be much more complicated. Also I think your module loader is really great and much more efficient as it is written in Rust.</p>
<h2 dir="auto">Mock</h2>
<p dir="auto">Something amazing would be to include a way to mock module in Deno. Since there is nothing like Jest in Deno, it's very hard to mock our code unless we use DI, but not everybody is using this pattern. Would be great to have:</p>
<ul dir="auto">
<li><code class="notranslate">Deno.mock('./your_module.ts', { here: () =&gt; the_mock })</code></li>
<li><code class="notranslate">Deno.mockRestore('./your_module.ts')</code></li>
</ul>