title: Confusing compiler error: Argument of type 'string' is not assignable to parameter of type
body: <p>I have an array with acceptable mime types:</p>
  <pre><code>export const frontend = { 
    ...
    zipMimeTypes: [
      &quot;application/zip&quot;,
      &quot;application/x-zip-compressed&quot;,
      &quot;multipart/x-zip&quot;,
    ],
  } as const;
  </code></pre>
  <p>I want to include it in another file and use it like so:</p>
  <pre><code>frontend.zipMimeTypes.includes(file.type)
  </code></pre>
  <p>However, my TS compiler is complaining about <code>file.type</code></p>
  <blockquote>
  <p>Argument of type 'string' is not assignable to parameter of type
  '&quot;application/zip&quot; | &quot;application/x-zip-compressed&quot; |
  &quot;multipart/x-zip&quot;'.</p>
  </blockquote>
  <p>I just do:</p>
  <pre><code>  [
      &quot;application/zip&quot;,
      &quot;application/x-zip-compressed&quot;,
      &quot;multipart/x-zip&quot;,
    ].includes(file.type)
  </code></pre>
  <p>It works</p>