Cannot resolve `const [imagemin, webp] = await Promise.all([import('imagemin'), import('imagemin-webp')]);`
adamlui opened this issue · 5 comments
adamlui commented
Error: 18:55 error Unable to resolve path to module 'imagemin' import/no-unresolved
Error: 18:75 error Unable to resolve path to module 'imagemin-webp' import/no-unresolved
ljharb commented
Are these packages installed locally?
adamlui commented
Indeed they are via package.json dependencies
...
"dependencies": {
"imagemin": "^9.0.0",
"imagemin-webp": "^8.0.0"
}
...
ljharb commented
The issue then, seems to be that both of these packages lack a main
, and use type: module, and this package doesn't support the exports
field yet.
I'd suggest putting them in import/ignore
in the meantime.
adamlui commented
I already did but maybe you should add a feature to auto-detect unsupported pkg types to not false positive in the meantime for better UX
ljharb commented
Due to the way resolvers are implemented, that would probably take almost as much time as the support itself.