Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AbortError: signal is aborted without reason #160

Open
SaravananArumugam24 opened this issue Aug 9, 2024 · 2 comments
Open

AbortError: signal is aborted without reason #160

SaravananArumugam24 opened this issue Aug 9, 2024 · 2 comments

Comments

@SaravananArumugam24
Copy link

Hi Team,

I am getting abortError & I have pasted by code below. Please let know if you have any solution

My Code:
import dynamic from 'next/dynamic';
import { DocumentViewerProps } from "@/Interface/DocumentViewer"
import { useEffect, useState } from 'react';
const DocViewer = dynamic(() => import('react-doc-viewer'), { ssr: false });

const DocumentViewer: React.FC = ({
URL,
}) => {
const [documents, setDocuments] = useState([]);

useEffect(() => {
    if (URL) {
        const docs = [{ uri: URL }];
        setDocuments(docs);
    }
}, [URL]);

return (
    <div>
        {documents.length > 0 ? (
            <DocViewer documents={documents} />
        ) : (
            <p>Loading documents...</p>
        )}
    </div>
);

}

export default DocumentViewer

@codeprepai
Copy link

Mention the fieType: '', in your IDocument object,it will work.
Example

const data: DOC_TYPE[] = [
  {
    id: 1,
    title: 'Network pdf',
    path: [{
      uri: ('https://pdfobject.com/pdf/sample.pdf'),
      fileType: 'pdf'
    }],
    local: false
  },
  {
    id: 2,
    title: 'Network pdf',
    path: [{
      uri: ('../src/assets/sample.pdf'),
      fileType: 'pdf'
    }],
    local: false
  },
];

@AndreiMrakov
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants