Skip to content

Commit

Permalink
Fix xmldom DOMParser import
Browse files Browse the repository at this point in the history
`xmldom` does not export `XMLDOMParser`, it exports `DOMParser` instead (https://www.npmjs.com/package/xmldom).

With TypeScript, the following error occurs, which breaks the build:

```
./node_modules/epubjs/src/section.js:100:18-34 - Error: export 'XMLDOMParser' (imported as 'XMLDOMSerializer') was not found in 'xmldom' (possible exports: DOMImplementation, DOMParser, XMLSerializer)
```

Making the correction manually in the local node_modules fixes this, but it's obviously not a longterm solution.
  • Loading branch information
tgv1975 authored Jun 20, 2021
1 parent 5c7f21d commit 9267148
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/section.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Hook from "./utils/hook";
import { sprint } from "./utils/core";
import { replaceBase } from "./utils/replacements";
import Request from "./utils/request";
import { XMLDOMParser as XMLDOMSerializer } from "xmldom";
import { DOMParser as XMLDOMSerializer } from "xmldom";

/**
* Represents a Section of the Book
Expand Down

0 comments on commit 9267148

Please sign in to comment.