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

Cannot read properties of null (reading 'childNodes') #242

Open
lemonllmm opened this issue May 7, 2024 · 2 comments
Open

Cannot read properties of null (reading 'childNodes') #242

lemonllmm opened this issue May 7, 2024 · 2 comments
Assignees
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers

Comments

@lemonllmm
Copy link
Contributor

在使用pptx 预览的时候,出现这个错误,但是word 就正常显示
接口返回的二进制文件流 pptx 无法显示 ,怎么解决呢 我的代码如下
const initPPt = async(RowfilePath:any)=>{
const response = await getFile(RowfilePath);
const blob = new Blob([response], { type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' })
if (refPPt?.current) {

      refPPt?.current?.setAttribute('src', '');
      const url = URL.createObjectURL(blob);
      if(refPPt.current){
        refPPt?.current?.setAttribute('src', url);
        URL.revokeObjectURL(url) 
      
      }
    }

}

@chaxus
Copy link
Owner

chaxus commented May 7, 2024

application/vnd.openxmlformats-officedocument.wordprocessingml.document这个格式是docx的吧,pptx的格式是application/vnd.openxmlformats-officedocument.presentationml.presentation,看下是不是这个问题导致的。常见的MIME类型列表有:MDN Common MIME types

@chaxus chaxus self-assigned this May 7, 2024
@chaxus chaxus added documentation Improvements or additions to documentation good first issue Good for newcomers labels May 7, 2024
@lemonllmm
Copy link
Contributor Author

good

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants