Skip to content

module: better error for named exports from cjs

We do not support importing named exports from a CJS module. This change decorates the error message for missing named exports in the case that the module being imported is expected to be CJS by the ESM loader.

Some high level questions

  • Are folks ok with how I've decorated the error? It is a bit fragile, as it relies on the format of the error in V8.
  • Are folks ok with the copy of the error message? I took a quick stab at it but it could maybe be better

Needs a test, but wanted to confirm folks would be open to doing this before hacking on a test.

Merge request reports

Loading