title: How to import PDF file with react-file-viewer in Next.js?
body: <p>I want to use file-viewer in Next.js, but I get this error:</p>
  <blockquote>
  <p>./public/pdf.pdf Module parse failed: Unexpected token (1:0) You may
  need an appropriate loader to handle this file type, currently no
  loaders are configured to process this file. See <br />
  &gt; %PDF-1.3 <br />
  | %���� <br />
  |</p>
  </blockquote>
  <p>How can I solve this problem?</p>
  <p>my code:</p>
  <pre><code>import FileViewer from &quot;react-file-viewer/src/components&quot;;
  import pdf from &quot;../../../public/pdf.pdf&quot;
  
  ...(in component)
  
   {openFileViewer ? &lt;FileViewer fileType=&quot;pdf&quot; filePath={pdf}  /&gt; : null}
  </code></pre>