File-viewer в next.js

Я хочу использовать file-viewer в next.js, но выводит ошибку:

./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 \

%PDF-1.3 | %���� |

как я могу решить эту проблему? что нужно добавить в next-config.js??

Мой код прост:

import FileViewer from "react-file-viewer/src/components";
import pdf from "../../../public/pdf.pdf"

...(в компоненте)
 {openFileViewer ? <FileViewer fileType="pdf" filePath={pdf}  /> : null}

Ответы (0 шт):