millet0328 / docx-preview-sync

The docx document synchronously rendering library
https://millet0328.github.io/docx-preview-sync/
Apache License 2.0
0 stars 0 forks source link

Angular cannot compile the 'docx-preview-sync' #2

Closed wider2 closed 3 weeks ago

wider2 commented 4 months ago

Describe the bug Error: export 'praseAsync' (imported as 'docx') was not found in 'docx-preview-sync' (module has no exports) or Error: export 'renderAsync' (imported as 'docx') was not found in 'docx-preview-sync' (module has no exports)

Document I have installed the package "npm i docx-preview-sync", but When trying to compile the Angular project I have got the error.

Source code

import * as docx from 'docx-preview-sync';

docx.renderAsync(download.content, document.getElementById("wordContainer")) .then(x => console.log("docx: finished"));

millet0328 commented 4 months ago

Describe the bug Error: export 'praseAsync' (imported as 'docx') was not found in 'docx-preview-sync' (module has no exports) or Error: export 'renderAsync' (imported as 'docx') was not found in 'docx-preview-sync' (module has no exports)

Document I have installed the package "npm i docx-preview-sync", but When trying to compile the Angular project I have got the error.

Source code

import * as docx from 'docx-preview-sync';

docx.renderAsync(download.content, document.getElementById("wordContainer")) .then(x => console.log("docx: finished"));

Sorry,The Readme.md is old version from docx-preview.

Try to use parseSync function instead of parseAsync function. I rewrite Readme.md for this library,it's useful for user.

This library is still in the development stage, so it is not recommended to use it in production.