eslint-plugin-import-x: `Error: Cannot find module '../package.json'`

Issue

After upgrading from 4.9.1 to >= 4.10.0, I’m getting the following error in our webpack builds:

Image

Replication Steps

OS: I’m using Mac OS 14.2 running on Apple Silicon. This appears to not occur on Windows. Our GitHub Actions fail for this as well which is running on ubuntu-latest

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 16 (10 by maintainers)

Commits related to this issue

Most upvoted comments

@JounQin Thank you so much!!!

Thank you!!!

Not saying it isn’t but not sure why the upgrade from 4.9 to 4.10 would cause the issue – unless there was some change that I’m not handling properly.

@eamodio 4.9 -> 4.10 changes from pure commonjs to ESM as primary but commonjs is still supported. So it’s a minor change, and shouldn’t break normal eslint usage, but eslint-lite-webpack-plugin seems special.

As since I don’t have a Mac and this isn’t reproducible Windows nor Linux make it challenging for me to debug ATM.

I can consistently reproduce it on https://GitPod.io, you can try it with https://gitpod.io/?autostart=true#https://github.com/JounQin/vscode-gitlens/tree/chore/bump