title: Two equal file inputs sometimes throw TS2345: Argument of type 'FileList | null' is not assignable to parameter of type 'File[]' and sometimes work
body: <p>I'm working my way into Angular. I am building a CSV file reader, to compare two kinds of csv data files. For this I have two component with almost identical setup, only the data is processed differently. Therefore part of both components are identical. It worked fine yesterday, but today after installing lodash-es ng serve came up with compile errors.</p>
  <p>It pointed to both file inputs</p>
  <pre><code>     &lt;input type=&quot;file&quot; name=&quot;input1&quot; class=&quot;form-control&quot;
             #upload1 (change)=&quot;onChange1(upload1.files)&quot; multiple
            value=&quot;process1&quot; /&gt;
  </code></pre>
  <p>and</p>
  <pre><code>     &lt;input type=&quot;file&quot; name=&quot;input2&quot; class=&quot;form-control&quot;
             #upload2 (change)=&quot;onChange2(upload2.files)&quot; multiple
            value=&quot;process2&quot; /&gt;
  </code></pre>
  <p>the start of both <code>(change)</code> functions is the same:</p>
  <pre><code>  onChangeX(files: File[]): void {
      if (files[0]) {
         Do stuff here
      }
  </code></pre>
  <p>Atfer commenting out both inputs it compiles fine and I can use <code>ng serve</code> to test the page. Atfer commentingin both inputs ONE is throwing the error, the other input works fine. Now I can reproduce the <code>TS2345: Argument of type 'FileList | null' is not assignable to parameter of type 'File[]'. Type 'null' is not assignable to type 'File[]'.</code> by commenting in and out the input I commented in last.
  When quitting the ng serve and restarting it, it will again start by throwing the error on both inputs. Again, commenting out both with show the website, if I comment both back in again, now in different order the one that worked beforehand will now throw the error and the other one will now work fine.</p>
  <p>Can anyone please explain what is happening and how to fix this problem? I tried copying the code back again, renaming functions, it always goes &quot;Both throw error&quot; -&gt; One worksm one doesn't.</p>
  <p>Thanks in advance</p>