Error: The loader html-webpack-plugin didn't return html.

See original GitHub issue

Bug report

Since v5.22, build are failing with this error:

ERROR in   Error: The loader "/Users/my-user/project/node_modules/html-webpack-plugin/lib/loader.js!//Users/my-user/project/src/app/index.html" didn't return html.

  - index.js:336 HtmlWebpackPlugin.evaluateCompilationResult
    [ni-xbox2]/[html-webpack-plugin]/index.js:336:24

  - index.js:243 Promise.resolve.then
    [ni-xbox2]/[html-webpack-plugin]/index.js:243:22

  - next_tick.js:68 process._tickCallback
    internal/process/next_tick.js:68:7



webpack 5.22.0 compiled with 1 error and 1 warning in 73981 ms
ℹ 「wdm」: Failed to compile.

What is the current behavior? The build are failing, saying that the html file did not return an HTML output.

If the current behavior is a bug, please provide the steps to reproduce. Upgrade webpack from v5.21 to v5.22, reinstall node_modules and webpack will fail to build the project.

What is the expected behavior? Webpack should build the project.

Other relevant information: webpack version: v5.22 Node.js version: v15.8.0 Operating System: MacOs Catalina v10.15.7 Additional tools:

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:5
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

26reactions
chenxsancommented, Feb 16, 2021

As far as I know, the latest html-webpack-plugin is v5.1.0, and it’s webpack 5 compatible. So try to upgrade html-webpack-plugin first.

10reactions
brrianncommented, Feb 16, 2021

Thank you Sam, I forgot to update this thread - upgrading html-webpack-plugin to v5.1.0 did indeed fix the issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

6 - Stack Overflow
HtmlWebpackPlugin - ERROR in Error: The loader "[...]/html-webpack-plugin - /lib/loader.js!/[...]/src/index.html" didn't return html · Ask ...
Read more >
html-loader - webpack
webpack is a module bundler. Its main purpose is to bundle JavaScript files for usage in a browser, yet it is also capable...
Read more >
html-webpack-plugin | Yarn - Package Manager
Fast, reliable, and secure dependency management.
Read more >
Processing HTML with a webpack Plugin
To add this functionality to webpack, we'll use our first plugin called HtmlWebpackPlugin. What's the difference between a webpack loader ...
Read more >
How I solved and debugged my Webpack issue through trial ...
const HtmlWebpackPlugin = require('html-webpack-plugin'); const WebpackMd5Hash = require('webpack-md5-hash');
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found