title: Error in production build: Index html generation failed
body: <p>Upgraded the <strong>Angular 10</strong> project to <strong>Angular 12</strong>. But now on running production build, it is giving error</p>
  <blockquote>
  <p>Index HTML generation failed.<br />
  undefined:6:720366 missing '}'</p>
  </blockquote>
  <pre><code>ng build --configuration production --aot
  </code></pre>
  <p><a href="https://i.stack.imgur.com/bISnp.png" rel="noreferrer"><img src="https://i.stack.imgur.com/bISnp.png" alt="enter image description here" /></a></p>
  <p>It is very difficult to find the error because it points to the generated HTML file.
  Node log will no do much.</p>
  <p>The content of <code>index.html</code></p>
  <pre><code>&lt;!doctype html&gt;
  &lt;html lang=&quot;en&quot;&gt;
  
  &lt;head&gt;
      &lt;title&gt;Quiz - Admin&lt;/title&gt;
      &lt;base href=&quot;/&quot;&gt;
      &lt;meta charset=&quot;utf-8&quot;&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
  
  &lt;app&gt;&lt;/app&gt;
  
  &lt;/body&gt;
  
  &lt;/html&gt;
  </code></pre>
  <p>While running the development build, locally does not give any error, even <code>ng build</code> completed successfully</p>
  <p>Please check the build pipeline here: <a href="https://github.com/anuj9196/quiz-app/runs/2589355739?check_suite_focus=true#step:7:56" rel="noreferrer">https://github.com/anuj9196/quiz-app/runs/2589355739?check_suite_focus=true#step:7:56</a></p>