TypeError: (0 , html_to_docx_1.default) is not a function
Opened this issue · 0 comments
subashdbc commented
Below is my code, I try to convert this string, and I get this issue
const fileBuffer = await HTMLtoDOCX(htmlString, null, {
^
TypeError: (0 , html_to_docx_1.default) is not a function
import HTMLtoDOCX from 'html-to-docx';
import { saveAs } from 'file-saver';
export class AuthService {
async convertion() {
const htmlString = `<p>Hello world</p>`;
const fileBuffer = await HTMLtoDOCX(htmlString, null, {
table: { row: { cantSplit: true } },
footer: true,
pageNumber: true,
});
saveAs(fileBuffer, 'html-to-docx.docx');
}
}
package.json
"html-to-docx": "^1.4.0",