darrenscerri / duplicate-package-checker-webpack-plugin

🕵️ Webpack plugin that warns you when a build contains multiple versions of the same package
MIT License
707 stars 29 forks source link

Weird error: "Resolving ... for build dependencies doesn't lead to expected result .... Resolving dependencies are ignored for this path." #61

Open matthias-ccri opened 11 months ago

matthias-ccri commented 11 months ago

This probably isn't an issue with the duplicate package checker plugin, but this warning is surfaced by it. Does anyone know of potential solutions to solve it?

<w> [webpack.cache.PackFileCacheStrategy/webpack.FileSystemInfo] Resolving 'color-name/package.json' in /path/to/project/node_modules/duplicate-package-checker-webpack-plugin/lib for build dependencies doesn't lead to expected result '/path/to/project/node_modules/color-name/package.json', but to '/path/to/project/node_modules/duplicate-package-checker-webpack-plugin/node_modules/color-name/package.json' instead. Resolving dependencies are ignored for this path.
<w>  at unknown 4 color-name/package.json
<w>  at file dependencies /path/to/project/node_modules/duplicate-package-checker-webpack-plugin/lib/index.js
<w>  at file /path/to/project/node_modules/duplicate-package-checker-webpack-plugin/lib/index.js
<w>  at file dependencies /path/to/project/sub/path/webpack.config.js
<w>  at file /path/to/project/sub/path/webpack.config.js
<w>  at resolve commonjs /path/to/project/sub/path/webpack.config.js
<w> [webpack.cache.PackFileCacheStrategy/webpack.FileSystemInfo] Resolving 'color-convert/package.json' in /path/to/project/node_modules/duplicate-package-checker-webpack-plugin/lib for build dependencies doesn't lead to expected result '/path/to/project/node_modules/color-convert/package.json', but to '/path/to/project/node_modules/duplicate-package-checker-webpack-plugin/node_modules/color-convert/package.json' instead. Resolving dependencies are ignored for this path.
<w>  at unknown 4 color-convert/package.json
<w>  at file dependencies /path/to/project/node_modules/duplicate-package-checker-webpack-plugin/lib/index.js
<w>  at file /path/to/project/node_modules/duplicate-package-checker-webpack-plugin/lib/index.js
<w>  at file dependencies /path/to/project/sub/path/webpack.config.js
<w>  at file /path/to/project/sub/path/webpack.config.js
<w>  at resolve commonjs /path/to/project/sub/path/webpack.config.js
matthias-ccri commented 11 months ago

I was able to resolve the issues by removing the duplicate packages from my project using yarn resolutions:

  "resolutions": {
    "color-convert": "2.0.1",
    "color-name": "1.1.4",
...