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

missing dependency (html-minifier) #1311

Closed
obartra opened this issue Nov 11, 2019 · 6 comments
Closed

missing dependency (html-minifier) #1311

obartra opened this issue Nov 11, 2019 · 6 comments

Comments

@obartra
Copy link

obartra commented Nov 11, 2019

Expected behaviour

Webpack build succeeds

Current behaviour

Webpack build fails, requiring "html-minifier" from "html-webpack-plugin"

ERR!   Error: Cannot find module 'html-minifier'
ERR!   Require stack:
ERR!   - /myproject/node_modules/html-webpack-plugin

Manually installing html-minifier fixes the issue

Environment

On [email protected], [email protected], [email protected], [email protected]

Config

NA

Relevant Links

NA

Additional context

I suspect adding html-minifier to html-webpack-plugin dependencies would fix the issue, happy to contribute if that's the desired change

@jantimon
Copy link
Owner

Thanks for the heads up 👍 will take a look

jantimon added a commit that referenced this issue Nov 11, 2019
@jantimon
Copy link
Owner

Unfortunately I introduced this with #1309 - however all builds were green 🤔

@obartra
Copy link
Author

obartra commented Nov 11, 2019

My guess is that it's because html-loader is included as a dev dependency which installs it but it's not available by the package when published (only dependencies are).

You should be able to repro this issue if instead of npm ci or npm i you run npm i --production

@jantimon
Copy link
Owner

jantimon commented Nov 11, 2019

Hey @obartra

can you please verify that it works now?
[email protected]

@obartra
Copy link
Author

obartra commented Nov 11, 2019

I was using html-webpack-plugin through storybook so I don't have specific control on the version but regenerating the package-lock.json succeeds now without html-minifier as an explicit dependency so I think that did the trick!

Thanks so much for the quick response 🎉

@jantimon
Copy link
Owner

Thanks for your feedback 👍👍

@lock lock bot locked as resolved and limited conversation to collaborators Dec 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants