Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot resolve const [imagemin, webp] = await Promise.all([import('imagemin'), import('imagemin-webp')]); #3119

Open
adamlui opened this issue Dec 16, 2024 · 5 comments

Comments

@adamlui
Copy link

adamlui commented Dec 16, 2024

https://github.com/adamlui/js-utils/blob/23b8bbb60944f8207e9793ad3ec021ffedb39f9e/img-to-webp/img-to-webp.js#L18C1-L18C94 results in

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
Copy link
Member

ljharb commented Dec 16, 2024

Are these packages installed locally?

@adamlui
Copy link
Author

adamlui commented Dec 18, 2024

Indeed they are via package.json dependencies

...
  "dependencies": {
    "imagemin": "^9.0.0",
    "imagemin-webp": "^8.0.0"
  }
...

@ljharb
Copy link
Member

ljharb commented Dec 18, 2024

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
Copy link
Author

adamlui commented Dec 18, 2024

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
Copy link
Member

ljharb commented Dec 18, 2024

Due to the way resolvers are implemented, that would probably take almost as much time as the support itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants