-
Notifications
You must be signed in to change notification settings - Fork 352
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
Cannot read property 'uint8array' of undefined in docxgen.js #102
Comments
Can you please post your whole stacktrace ? That would help. It seems strange to me because the demos use exactly the same code, the only difference seems to be the browserify command. http://javascript-ninja.fr/docxgenjs/examples/demo.html |
If you don't specifically need the qrcode functionality, I also suggest you to switch to version 1.0. Loading a docx is better written than: See the new demos : http://javascript-ninja.fr/docxtemplater/v1/examples/demo.html the new docs : http://docxtemplater.readthedocs.org/en/1.x/goals.html New readme: https://github.com/edi9999/docxtemplater/tree/1.x |
This is the stack trace of the error: "TypeError: Cannot read property 'uint8array' of undefined Once I get this working, my goal is to replace/insert an image of the user's signature (captured through other means) into the document. Does that require the qrcode functionality? In v.1 documents (https://github.com/edi9999/docxtemplater/tree/1.x), I clicked on the Replacing Images link, but it didn't take me the the replacing image section. |
Yep you can't replace images in 1.x for now, that will come later when the module system comes out. I'm looking into your error |
I have been able to replicate the issue when they is no file. Is they a file named If yes, can you check your xhr requests ? (You can see them in the debug tools of chrome or firefox, under the network tab) |
The issue was the .docx file was not in the same folder as the HTML page. It may be good to throw a more specific exception if the file cannot be found. Thank you for your help and your quick response. |
I have just added an error on that particular case so that the next users won't hang on that particular issue |
When attempting to call loadFromeFile on an instance of the docxgen function, I'm getting the following error:
Error: Uncaught TypeError: Cannot read property 'uint8array' of undefined in https://localhost/scripts/lib/docxgen.js at line 17139
My code is structured like so (note that I've used browserify to create a standalone file where docxgen is the global variable, as suggested in this issue #101 ):
The error is occurring in the exports.transformTo method at this line:
var result = transform[inputType]outputType;
In the exports.transformTo method, the outputType parameter is "uint8array", and the input parameter is true. When the exports.getTypeOf(input) method is ran, the value true is not a valid input, so undefined is returned. Thus, transform[undefined]... throws an error.
I've posted a minified version of my compiled code at http://pastebin.com/DUvJ3rM8 (it had to minified, since pastebin has a size limit for non-members)
Let me know if any more information is needed to resolve this issue I'm having.
Thank You,
The text was updated successfully, but these errors were encountered: