deno/tests/specs/bundle/error_message/imports-css.tsx
Nathan Whitaker bf6292b170
fix(bundle): improve error handling and reporting (#29744)
We were effectively ignoring our diagnostics, and instead falling back
to esbuild (and then displaying the esbuild diagnostics). That was
mostly for simplicity and so we would fall back to esbuild handling
unsupported things (for instance css imports).

This does a small refactor on the module loader to give us an API that
doesn't have to adhere to the deno_core ModuleLoader API. That lets us
return and handle errors more concretely, instead of having indirection
and downcasting.

Now, we only ignore our errors about being unable to load unsupport file
types, and the rest we handle ourselves.

I've also aligned the formatting of esbuild errors with ours, so it
should be more uniform. A few examples (dbgdeno is just an alias for the
debug build of this PR):


![Screenshot 2025-06-13 at 5 17
53 PM](https://github.com/user-attachments/assets/e9595d4a-295a-4a10-98c7-0cb169477d24)
2025-06-16 14:11:14 -07:00

1 line
20 B
TypeScript