Skip to content

Commit

Permalink
Add TODO comment for MODULE_NOT_FOUND error code
Browse files Browse the repository at this point in the history
  • Loading branch information
ybiquitous committed Nov 21, 2023
1 parent f98cd04 commit ab38fa2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/getPostcssResult.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ async function getCustomSyntax(customSyntax, basedir) {
error &&
typeof error === 'object' &&
'code' in error &&
// TODO: Remove 'MODULE_NOT_FOUND' when we drop the CJS support.
// See https://nodejs.org/api/errors.html#module_not_found
(error.code === 'MODULE_NOT_FOUND' || error.code === 'ERR_MODULE_NOT_FOUND') &&
'message' in error &&
typeof error.message === 'string' &&
Expand Down
2 changes: 2 additions & 0 deletions lib/getPostcssResult.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ async function getCustomSyntax(customSyntax, basedir) {
error &&
typeof error === 'object' &&
'code' in error &&
// TODO: Remove 'MODULE_NOT_FOUND' when we drop the CJS support.
// See https://nodejs.org/api/errors.html#module_not_found
(error.code === 'MODULE_NOT_FOUND' || error.code === 'ERR_MODULE_NOT_FOUND') &&
'message' in error &&
typeof error.message === 'string' &&
Expand Down

0 comments on commit ab38fa2

Please sign in to comment.