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

slash should be a runtime dependency #15

Open
Sidnioulz opened this issue Jul 26, 2021 · 1 comment
Open

slash should be a runtime dependency #15

Sidnioulz opened this issue Jul 26, 2021 · 1 comment

Comments

@Sidnioulz
Copy link

Hi,

Currently trying to use this plugin in a yarn 2 project. It incorrectly lists slash (and, possibly, other dependencies) as a devDependency even though it is used in the source code and should therefore be a runtime dependency. This, in yarn 2, results in the following error:

Error: html-webpack-deploy-plugin tried to access slash, but it isn't declared in its dependencies; this makes the require call ambiguous and unsound.

Required package: slash (via "slash")
Required by: html-webpack-deploy-plugin@virtual:[snip]#npm:3.0.0 (via /home/[snip]/.yarn/$$virtual/html-webpack-deploy-plugin-virtual-954ac73edc/0/cache/html-webpack-deploy-plugin-npm-3.0.0-94a8d4aa9b-8e5a71f1b8.zip/node_modules/html-webpack-deploy-plugin/src/)

Which makes it impossible to use html-webpack-deploy-plugin in a Yarn 2 context.

@jharris4
Copy link
Owner

Thanks for reporting this interesting issue. I haven't tried out yarn 2 yet so I've never seen this kind of problem.

slash is a dependency of html-webpack-tags-plugin which is a dependency of this package (and I also maintain both packages) so with yarn 1 it just worked since it's a transitive dependency...

I also am usually wary of adding re-used dependencies too many times as that runs the risk of having the version get out of sync and then multiple versions get installed. But I agree that leaving out of the dependencies of this plugin is odd/non-ideal. That said, it feels strange to me that since yarn 1 was less than great at handling peer dependencies and dependency chains in general, that they haven't improve the support/detection of such chains in version 2.

Would you care to put up a PR to make it work with yarn 2?

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

No branches or pull requests

2 participants