Closed itsCheithanya closed 2 months ago
@itsCheithanya More informations I need to can help. What kind of files are you trying to render? Paste here some of your code.
I was using node version 14 maybe that's why it didn't work , I updated the node to version 20 its working now and one more thing the code doesn't preview local docx and pptx files
import DocViewer, { DocViewerRenderers } from "react-doc-viewer";
import "@cyntler/react-doc-viewer/dist/index.css";
function App() {
const docs = [
{ uri: require("./POSTER-2024_NO-FUND_Final.docx") },
];
return <DocViewer documents={docs} pluginRenderers={DocViewerRenderers} />;
}
export default App;
@itsCheithanya OK, so now your problem is what is described here: https://github.com/cyntler/react-doc-viewer?tab=readme-ov-file#important-note. So sorry but your local docx and pptx files can't be rendered. They must be public with access URL.
when running
npm start
the compiler throws this error