docx
docx copied to clipboard
NPM 8.5.0 Package / wrong types for patchDocument
Wrong version of from-docx.ts packaged for NPM 8.5.0 package?
I installed the docx 8.5.0 Package via NPM "dependencies": { "docx": "^8.5.0" } and wanted to run the Demos
- 85-template-document.ts
- 87-template-document.ts
- 88-template-document.ts
- 89-template-document.ts
but they are not working, because of the wrong type definition for the function "patchDocument".
When looking into build/patcher/from-docx.d.ts of the downloaded NPM package, it shows that the exported type for patchDocument has another parameter definition as used in the demos:
It's also explained on the pull requests page, that there had been breaking changes: https://github.com/dolanmiu/docx/pull/2497 but it seems that it did not get it into the NPM package.
On gitHub when looking into the source the type is defined that way that it is working with the demos.
same problem
Same problem
Yes, this is not released as of yet
Will be part of the next major version as this is a breaking API change
Yes, this is not released as of yet
Will be part of the next major version as this is a breaking API change
@dolanmiu do you have an estimated date of when the next major version will be released? 😀
i faced the same issue. what i did as workaround:
- clone the project
- npm install && npm run build
- go to your own project in ./myproject/node_modules/docx and delete the build folder
- copy the build folder of the docx project into ./myproject/node_modules/docx
- the code should work now
but please be careful on this - its a workaround!