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

Revert "Use html-webpack-plugin for minifying HTML in production" #692

Merged
merged 1 commit into from
Aug 8, 2023

Conversation

lslezak
Copy link
Contributor

@lslezak lslezak commented Aug 8, 2023

Problem

The Agama installer displays an empty screen and the browser log contains errors like:

Uncaught TypeError: Cannot read properties of null (reading 'children')
Uncaught DOMException: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node.

Especially this error is strange:

Uncaught Error: React Refresh runtime should not be included in the production bundle.

According to out Webpack configuration that react-refresh plugin should be included only in the development mode, not in production. 🤔

Solution

It turned out that the problem is caused by using the html-webpack-plugin which somehow conflicts with the react-refresh plugin. When it is enabled the production build contains this in the index.html file:

<script defer="defer" src="reactRefreshSetup.js">

After reverting #680 it works fine.

That's quite strange, I did several tests with the html-webpack-plugin plugin and it worked fine, I'm not sure what I did wrong/differently... 😳

Replacement

I found the html-minimizer-webpack-plugin, I'll try it later, maybe it works better...

This reverts commit b00fb3c.

It seems there is a conflict between the "html-webpack-plugin"
and "react-refresh" plugins :-/
@coveralls
Copy link

Coverage Status

coverage: 72.203%. remained the same when pulling 70c7bd2 on revert_html-webpack-plugin into 050ed9d on master.

Copy link
Contributor

@ancorgs ancorgs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Let's go for the revert while we find something better.

@imobachgs
Copy link
Contributor

Thanks for finding the issue!

@lslezak lslezak merged commit 7d35cdf into master Aug 8, 2023
14 checks passed
@lslezak lslezak deleted the revert_html-webpack-plugin branch August 8, 2023 09:10
@imobachgs imobachgs mentioned this pull request Sep 26, 2023
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

Successfully merging this pull request may close these issues.

4 participants