Stylelint jobs are failing due to upstream updates
Problem/Motivation
Stylelint jobs are failing with this stack trace:
node:internal/process/promises:288
triggerUncaughtException(err, true /* fromPromise */);
^
Error [ERR_UNSUPPORTED_DIR_IMPORT]: Directory import '/builds/project/eca/web/core/node_modules/stylelint-junit-formatter' is not supported resolving ES modules imported from /builds/project/eca/web/core/node_modules/stylelint/lib/utils/dynamicImport.mjs
Did you mean to import /builds/project/eca/web/core/node_modules/stylelint-junit-formatter/index.js?
at new NodeError (node:internal/errors:405:5)
at finalizeResolution (node:internal/modules/esm/resolve:321:11)
at moduleResolve (node:internal/modules/esm/resolve:980:10)
at defaultResolve (node:internal/modules/esm/resolve:1206:11)
at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:404:12)
at ModuleLoader.resolve (node:internal/modules/esm/loader:373:25)
at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:250:38)
at ModuleLoader.import (node:internal/modules/esm/loader:336:34)
at importModuleDynamically (node:internal/modules/esm/translators:143:35)
at importModuleDynamicallyCallback (node:internal/modules/esm/utils:176:14) {
url: 'file:///builds/project/eca/web/core/node_modules/stylelint-junit-formatter',
code: 'ERR_UNSUPPORTED_DIR_IMPORT'
}
Node.js v18.20.4
Example job: https://git.drupalcode.org/project/eca/-/jobs/3746357
This is probably caused by this core commit: drupal@7f47553b
Proposed resolution
@fjgarlin found a possible workaround: https://github.com/eddies/stylelint-junit-formatter/issues/12
This probably needs to be added to the CI template then.
Related issue: Issue #3492697
Edited by drupalbot