[英]Error: html-webpack-plugin could not minify the generated output
while deploying to heroku i am getting following error .在部署到 heroku 时,我收到以下错误。 i am unable to resolve it as i dont know anything about html-webpack-plugin.
我无法解决它,因为我对 html-webpack-plugin 一无所知。 help please.
请帮忙。 my codes-https://github.com/utkarsh-cmd/Shop_INN
我的代码-https://github.com/utkarsh-cmd/Shop_INN
Creating an optimized production build...
remote: Failed to compile.
remote:
remote: Error: html-webpack-plugin could not minify the generated output.
remote: In production mode the html minifcation is enabled by default.
remote: If you are not generating a valid html output please disable it manually.
remote: You can do so by adding the following setting to your HtmlWebpackPlugin config :
remote: |
remote: | minify: false
remote: |
This may be happened because of a syntax error in index.html(inside public folder).这可能是由于 index.html(公共文件夹内)中的语法错误而发生的。 Eg: missing tag in index.html
例如:index.html 中缺少标签
In my case error was:-就我而言,错误是:-
Error: html-webpack-plugin could not minify the generated output.
错误:html-webpack-plugin 无法缩小生成的输出。 In production mode the html minifcation is enabled by default.
在生产模式下,默认情况下启用 html 缩小。
If you are not generating a valid html output please disable it man ually.如果您没有生成有效的 html 输出,请手动禁用它。 You can do so by adding the following setting to your HtmlWebpackPl ugin config: |
您可以通过将以下设置添加到您的 HtmlWebpackPl ugin 配置来实现: | |
| minify: false |
缩小:假 | See https://github.com/jantimon/html-webpack-plugin#options for det ails.
有关详细信息,请参阅https://github.com/jantimon/html-webpack-plugin#options 。 For parser dedicated bugs please create an issue here: https://danielruf.github.io/html-minifier-terser/ Parse Error: <meta name="viewport" content="user-scalable="no" />
对于解析器专用错误,请在此处创建问题: https : //danielruf.github.io/html-minifier-terser/解析错误:<meta name="viewport" content="user-scalable="no" />
......
As you can see on line 6 in public/index.html
正如你在
public/index.html
第 6 行看到的
<meta name="viewport" content="user-scalable="no" /> (I previously made change to it)
this was the actual problem这是实际问题
So I replaced this with所以我把它换成了
<meta name="viewport" content="width=device-width, initial-scale=1.0" />(this is defualt one)
again yarn run build.
再次
yarn run build.
and problem solved.并解决了问题。
It can be a syntax error, like a missed quote or closing tag inside your file.html.它可能是一个语法错误,比如在 file.html 中遗漏了引号或结束标记。
I recommend you to pass in your code into an HTML Validator or debugger, the automated check of errors for html can save you a lot of time.我建议您将代码传递到 HTML 验证器或调试器中,自动检查 html 错误可以为您节省大量时间。 I used this one and solved the tiny bug:
我使用了这个并解决了这个小错误:
https://www.freeformatter.com/html-validator.html https://www.freeformatter.com/html-validator.html
最好的方法是编辑您的 index.html 并修复错误,我建议使用https://jsonformatter.org/html-validator来修复 .html 文件
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.