profile
viewpoint

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.

nodejs/modules

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.

useful!

Related questions

No questions were found.
source:https://uonfu.com/
Github User Rank List