Will this library work on vanilla Javascript / Jquery? #2130
-
I'm able to generate documents using vanilla javascript and a simple HTML file (not hosted on the server) however I'm facing issues when reading existing document mentioned in the below example https://github.com/dolanmiu/docx/blob/master/demo/85-template-document.ts Here's a screenshot of error Here's a link to code-sandbox - https://codesandbox.io/s/zealous-elion-7dt2hv?file=/src/index.js When I click on 'Read Existing Document' I get those errors Question is can we use this library without Node.js and without hosting it on the server and just use javascript/jquery? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 11 replies
-
It does yes, please refer to: https://github.com/dolanmiu/docx/blob/master/demo/browser-demo.html |
Beta Was this translation helpful? Give feedback.
-
@dolanmiu - Ok I managed to resolve the node buffer no defined issue by adding node poly fill plugin for webpack - https://github.com/Richienb/node-polyfill-webpack-plugin however I'm now getting the below issue This error is thrown in the Packers module - here are some screenshots Browser PS: The same code runs under Node.js though |
Beta Was this translation helpful? Give feedback.
It does yes, please refer to:
https://github.com/dolanmiu/docx/blob/master/demo/browser-demo.html