Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NPM 8.5.0 Package / wrong types for patchDocument #2605

Closed
chkch1 opened this issue Feb 16, 2024 · 6 comments
Closed

NPM 8.5.0 Package / wrong types for patchDocument #2605

chkch1 opened this issue Feb 16, 2024 · 6 comments

Comments

@chkch1
Copy link

chkch1 commented Feb 16, 2024

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".
image

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:
image

It's also explained on the pull requests page, that there had been breaking changes: #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.

@laurent512
Copy link

same problem

@mateobv07
Copy link

Same problem

@dolanmiu
Copy link
Owner

dolanmiu commented Mar 1, 2024

Yes, this is not released as of yet

Will be part of the next major version as this is a breaking API change

@mateobv07
Copy link

mateobv07 commented Mar 4, 2024

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? 😀

@kunoSchlonz
Copy link

i faced the same issue. what i did as workaround:

  1. clone the project
  2. npm install && npm run build
  3. go to your own project in ./myproject/node_modules/docx and delete the build folder
  4. copy the build folder of the docx project into ./myproject/node_modules/docx
  5. the code should work now

but please be careful on this - its a workaround!

@dolanmiu
Copy link
Owner

dolanmiu commented Oct 10, 2024

Published 9.0.0 which has the correct types!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants