Describe the bug
Adding a HTML comment to the <body> that contains a closing body tag
ex: <!-- </body> -->
Will prevent the main scripts from being injected.
I tried to reproduce this with a minimal webpack configuration to determine if the plugin behaved that way on it's own.
However I was not able to reproduce the bug that way. I expect the issue is somewhere in the webpack configuration.
The obvious workaround is to not include comment with the body tag, and that will work for me, I'm filing this bug so that others who encounter it can find the solution here.
Did you try recovering your dependencies?
This is a fresh project, so It is unlikely that this is the issue.
Which terms did you search for in User Guide?
Not Relevant
Environment
A fresh build using npx create-react-app my-app --template typescript was used.
Steps to reproduce
(Write your steps here:)
- Setup a new environment using the typescript template.
npx create-react-app my-app --template typescript
- A a comment with a closing body tag to the body of the generate index.html template:
<!-- </body> -->
- run
npm run build
- Inspect the output
index.html
- observe the scripts were not injected
Expected behavior
Html Comments should be ignored, and the scripts should be injected.
Actual behavior
The scripts are not injected into the template.
Reproducible demo
Given that this doesn't take much off the template to reproduce, I think this is unnecessary.
Describe the bug
Adding a HTML comment to the
<body>that contains a closing body tagex:
<!-- </body> -->Will prevent the main scripts from being injected.
I tried to reproduce this with a minimal webpack configuration to determine if the plugin behaved that way on it's own.
However I was not able to reproduce the bug that way. I expect the issue is somewhere in the webpack configuration.
The obvious workaround is to not include comment with the body tag, and that will work for me, I'm filing this bug so that others who encounter it can find the solution here.
Did you try recovering your dependencies?
This is a fresh project, so It is unlikely that this is the issue.
Which terms did you search for in User Guide?
Not Relevant
Environment
A fresh build using
npx create-react-app my-app --template typescriptwas used.Steps to reproduce
(Write your steps here:)
npx create-react-app my-app --template typescript<!-- </body> -->npm run buildindex.htmlExpected behavior
Html Comments should be ignored, and the scripts should be injected.
Actual behavior
The scripts are not injected into the template.
Reproducible demo
Given that this doesn't take much off the template to reproduce, I think this is unnecessary.