Q:

getting error from my local html project - cannot read property 'concat' of undefined

I am making a local html file that I will use later to make article/reader mode for any website.
I am doing that by fetching the website html, converting it to dome document and run it in Readability.js

$(document).ready(function() {
  $("form").submit(function(event) {

    var parser = new DOMParser();
    var doc = parser.parseFromString($("#url").val(), 'text/html');
    window.console.log(doc)
    var article = window.Readability(doc).parse();
    window.console.log(article)

    event.preventDefault()
  });
});
<!DOCTYPE html>
<html>

<head>
  <meta charset='utf-8'>
  <title>test </title>
  <meta name='viewport' content='width=device-width, initial-scale=1'>
  <script src="Readability.js"></script>
  <script src="https://johnresig.com/files/htmlparser.js"></script>
  <!-- <script src="index.js"></script> -->
  <script src="https://cdnjs.cloudflare.com/ajax/libs/fetch-jsonp/1.0.6/fetch-jsonp.min.js"></script>
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
  <script src="https://unpkg.com/html-dom-parser@latest/dist/html-dom-parser.js"></script>



  <body>

    <form action="">
      html: <input id="url" type="text" name="urlField" value="<html>"><br>
      <input type="Submit" value="Submit">
    </form>

  </body>

</html>

But I am getting 

cannot read property 'concat' of undefined

A:

Please try with the following code:
Major change is var article = new Readability(doc).parse();
<!DOCTYPE html>
<html>
<head>
    <meta charset='utf-8'>
    <title>test </title>
    <meta name='viewport' content='width=device-width, initial-scale=1'>
    <script src="Readability.js"></script>
    <script src="https://johnresig.com/files/htmlparser.js"></script>
    <!-- <script src="index.js"></script> -->
    <script src="https://cdnjs.cloudflare.com/ajax/libs/fetch-jsonp/1.0.6/fetch-jsonp.min.js"></script>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
    <script src="https://unpkg.com/html-dom-parser@latest/dist/html-dom-parser.js"></script>
</head>
<body>
    <script>
        $(document).ready(function(){
          $("#btn-submit").click(function(event){
            var parser = new DOMParser();
            var doc = parser.parseFromString($("#url").val(), 'text/html');
            window.console.log(doc)
            var article = new Readability(doc).parse();
            window.console.log(article)
           event.preventDefault()
          });
        });

    </script>
    <form action="">
    html: <input id="url" type="text" name="urlField" value="https://www.google.com/"><br>
    <input type="button" value="Submit" id="btn-submit" >
  </form> 
</body>
</html>

