epub.js icon indicating copy to clipboard operation
epub.js copied to clipboard

Error: export 'XMLDOMParser' (imported as 'XMLDOMSerializer') was not found in 'xmldom' (possible exports: DOMImplementation, DOMParser, XMLSerializer)

Open bgaliz opened this issue 3 years ago • 5 comments

This error is located in epubjs/src/section.js. It was reported before, but the problem still remains.

bgaliz avatar Jul 01 '21 04:07 bgaliz

I also get this issue while working with angular

RatulSikder97 avatar Aug 09 '21 12:08 RatulSikder97

I solve the issue.

Step1: Use import * as epubjs from PATH_TO_NODE_MODULE

Step2: Make ts-lint issue(that show in import statement) false in tsconfig file

Or see this https://github.com/futurepress/epub.js/issues/1196

RatulSikder97 avatar Aug 12 '21 03:08 RatulSikder97

Hi RatulSikder97,

Please what compiler issue to set as false? I am having this issue also.

There is a PR to fix it, but it is not yet merged. So I am looking for a workaround

Thank you for your help

lesauf avatar Aug 20 '21 07:08 lesauf

"noImplicitAny": false in tsconfig compilerOptions works when epub directly imported from node_module. This can not solve the problem totally

I just change XMLDOMParser to DOMParser of section.js in node_module as like #1196. It makes the final solution.

RatulSikder97 avatar Aug 23 '21 04:08 RatulSikder97

I want to encrypt the page.xhtml files in the ePub file. How can I decrypt them before rendering the HTML? I see that ePub.js is parsing them into XML, so my encrypted data string is getting corrupted and not displaying correctly

tienn2t avatar Sep 10 '23 13:09 tienn2t