Ask questionsUse consistent error codes for MODULE_NOT_FOUND
Right now ESM uses
code: 'ERR_MODULE_NOT_FOUND' while CJS throws a similar error with
code: 'MODULE_NOT_FOUND'. So far that looks to be accidental and worth fixing so code that catches these kinds of mistakes doesn't have to worry about which loader happened to throw it.
Answer questions guybedford
ERR_MODULE_NOT_FOUND was actually an intentional upgrade path in the ESM resolver since all Node.js error codes start with
ERR_ these days.
If we want to change it to
MODULE_NOT_FOUND though I'm fine with that too.