You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As mentioned in a comment on a similar issue, resolution of @xmldom/xmldom does not work in certain scenarios, failing with the following error:
node:internal/modules/cjs/loader:1143
throw err;
^
Error: Cannot find module '<PATH TO PROJECT>/node_modules/apigeelint/node_modules/@xmldom/xmldom/lib/dom.js'
Require stack:
- <PATH TO PROJECT>/node_modules/apigeelint/lib/package/myUtil.js
- <PATH TO PROJECT>/node_modules/apigeelint/lib/package/Resource.js
- <PATH TO PROJECT>/node_modules/apigeelint/lib/package/Bundle.js
- <PATH TO PROJECT>/node_modules/apigeelint/lib/package/bundleLinter.js
- <PATH TO PROJECT>/node_modules/apigeelint/cli.js
at Module._resolveFilename (node:internal/modules/cjs/loader:1140:15)
at Module._load (node:internal/modules/cjs/loader:981:27)
at Module.require (node:internal/modules/cjs/loader:1231:19)
at require (node:internal/modules/helpers:177:18)
at <PATH TO PROJECT>/node_modules/apigeelint/lib/package/myUtil.js:220:12
at Object.<anonymous> (<PATH TO PROJECT>/node_modules/apigeelint/lib/package/myUtil.js:224:3)
at Module._compile (node:internal/modules/cjs/loader:1364:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1422:10)
at Module.load (node:internal/modules/cjs/loader:1203:32)
at Module._load (node:internal/modules/cjs/loader:1019:12) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'<PATH TO PROJECT>/node_modules/apigeelint/lib/package/myUtil.js',
'<PATH TO PROJECT>/node_modules/apigeelint/lib/package/Resource.js',
'<PATH TO PROJECT>/node_modules/apigeelint/lib/package/Bundle.js',
'<PATH TO PROJECT>/node_modules/apigeelint/lib/package/bundleLinter.js',
'<PATH TO PROJECT>/node_modules/apigeelint/cli.js'
]
}
After trying for a while, I managed to create an extremely simple reproduction project. The problem seemed to happen when using yarn (I tried with [email protected] and [email protected], was able to reproduce it in both cases) and when my project had a dependency on a library used by apigeelint but on a different version (in the reproduction scenario, debug).
The fix released in v2.57.0 traverses upwards looking for a node_modules directory, but it assumes it will find @xmldom/xmldom in the first one it finds and just stops looking, which is not always the case. Maybe a fix would be to check that @xmldom/xmldom actually exists in the node_modules directory it finds? I could submit a patch for it, as I've been playing around with it trying to figure out what the problem was.
The text was updated successfully, but these errors were encountered:
As mentioned in a comment on a similar issue, resolution of
@xmldom/xmldom
does not work in certain scenarios, failing with the following error:After trying for a while, I managed to create an extremely simple reproduction project. The problem seemed to happen when using yarn (I tried with [email protected] and [email protected], was able to reproduce it in both cases) and when my project had a dependency on a library used by apigeelint but on a different version (in the reproduction scenario,
debug
).The fix released in v2.57.0 traverses upwards looking for a
node_modules
directory, but it assumes it will find@xmldom/xmldom
in the first one it finds and just stops looking, which is not always the case. Maybe a fix would be to check that@xmldom/xmldom
actually exists in thenode_modules
directory it finds? I could submit a patch for it, as I've been playing around with it trying to figure out what the problem was.The text was updated successfully, but these errors were encountered: