Gabriel Morais
Gabriel Morais

Reputation: 165

Ng Build Parse Error

I'm trying to build my project which is working just fine with ng serve, but I'm getting the following error when I try to use ng build --prod:

ERROR in   Error: Parse Error: <link href=https://fonts.googleapis.com/icon?family=Material+Icons rel="stylesheet">
  <link href="styles.bb42829af637ad7517b8.bundle.css" rel="stylesheet"/></head>
  <body>
    <app-root></app-root>
  <script type="text/javascript" src="inline.12e6a1a2e3a1cffc56a7.bundle.js"></script><script type="text/java  script" src="polyfills.46af3f84a403e219371b.bundle.js"></script><script type="text/javascript" src="main.1a  6c58d7ac57bf63f021.bundle.js"></script></body>
  </html>

  - htmlparser.js:240 new HTMLParser
    [todo-app]/[html-minifier]/src/htmlparser.js:240:13

  - htmlminifier.js:944 minify
    [todo-app]/[html-minifier]/src/htmlminifier.js:944:3

  - htmlminifier.js:1300 exports.minify
    [todo-app]/[html-minifier]/src/htmlminifier.js:1300:16

  - index.js:296 
    [todo-app]/[html-webpack-plugin]/index.js:296:16

  - util.js:16 tryCatcher
    [todo-app]/[bluebird]/js/release/util.js:16:23

  - promise.js:512 Promise._settlePromiseFromHandler
    [todo-app]/[bluebird]/js/release/promise.js:512:31

  - promise.js:569 Promise._settlePromise
    [todo-app]/[bluebird]/js/release/promise.js:569:18

  - promise.js:614 Promise._settlePromise0
    [todo-app]/[bluebird]/js/release/promise.js:614:10

  - promise.js:693 Promise._settlePromises
    [todo-app]/[bluebird]/js/release/promise.js:693:18

  - async.js:133 Async._drainQueue
    [todo-app]/[bluebird]/js/release/async.js:133:16

  - async.js:143 Async._drainQueues
    [todo-app]/[bluebird]/js/release/async.js:143:10

  - async.js:17 Immediate.Async.drainQueues [as _onImmediate]
    [todo-app]/[bluebird]/js/release/async.js:17:14

It seems like this error is being caused by something on my index.html file, which is the following:

<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>To-Do List</title>
  <base href="/">

  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="icon" type="image/x-icon" href="favicon.ico">
  <link href="https://fonts.googleapis.com/css?family=Abhaya+Libre|Cormorant+Garamond:600|Montserrat" rel="stylesheet">
  <link href=https://fonts.googleapis.com/icon?family=Material+Icons rel="stylesheet">
</head>
<body>
  <app-root></app-root>
</body>

The whole app can be found in: GitHub Repo, any light on how to solve this issue is welcome!

Upvotes: 1

Views: 1229

Answers (1)

Pete
Pete

Reputation: 794

One issue is the below line doesn't have a quote around the href attribute value:

<link href=https://fonts.googleapis.com/icon?family=Material+Icons rel="stylesheet">

Add like so:

<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">

Upvotes: 1

Related Questions