esbuild_deno_loader icon indicating copy to clipboard operation
esbuild_deno_loader copied to clipboard

Module parse failure make the file unwatchable

Open jeiea opened this issue 1 year ago • 0 comments

Steps to reproduce

  1. Prepare the following files.
// a.ts
import "./b.ts";
// b.ts
export {};
  1. Run esbuild a.ts in watch mode with esbuild_deno_loader.
  2. Append ,, to b.ts and save.
  3. Remove ,, from b.ts and save.

Expected behavior

Error is recovered and it should be built.

Actual behavior

Some error like the following and nothing happens.

[ERROR] The module's source code could not be parsed: Unexpected token `,`. Expected identifier, string literal, numeric literal or [ for the computed key at

If we modify a.ts, it works fine again.

Additional context

https://github.com/jeiea/esbuild_deno_loader this works as expected, but it feels like monkey patching.

I think it should fail on load phase, not resolve phase.

jeiea avatar Oct 21 '23 19:10 jeiea