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
Error: Mismatched anonymous define() module #1073
Comments
the same to you ,the problem recurred in my project |
Same here |
I'm getting this error when using jsPDF with RequireJS, the error in the console actually points to part of the jspdf.min.js file that has a minified script of html2canvas 0.5.0-beta3 included. This version isn't AMD compliant, from looking at html2canvas it wasn't working with RequireJS until version 1.0.0-alpha10. I know you have an issue about modularising the dependencies #839 which I'm sure this fits under but do you think this is what's causing the mismatch error? Anyway we can update jsPDF to use the latest version of html2canvas? Here is a screenshot of VSC, I've copied and pasted the script from the Error in the console and found it in the jspdf.min.js file. |
The problem is, that I could simply change the define calls so that they are not anonymous anymore. But because I don't use your environments I can't check if it is working properly with my solution. If I supply you an modified jsPDF.debug.js, would/could you test if it is working? |
Sure I understand, I am also using this within a Qlik Sense extension so it's not a normal environment, I just supply the require definitions and they're dealt with by a higher power. Happy to test with a modified debug file, just let me know what you need me to do. |
I just required the current debug file I have and again the part of the code in the Error console seems to be related to the html2canvas 0.5.0-beta3 section. There's two errors actually, there and another one by the chick307 _hasarraybuffer part. |
Do you have the issue number of the hasarraybuffer bug? |
Accidently closed. Sry |
I'm using v1.3.5 and agree with you there. It's not an issue on here. I was referring to getting two console errors when requiring the 1.3.5 jspdf.debug.js file. One error points to the code related to html2canvas 0.5.0-beta3 which I think should be updated to the latest version. The other error message points to the part of the file that has the adler32cs code that does the _hasarraybuffer stuff. |
Removed anonymous define calls with PR #1646 |
Amazing, thank you arasabbasi this has worked a treat. No more console errors and it seems to be quicker performing the screenshot which is a bonus. Weirdly it works on my local machine really well but on our dev server some of the image seems to loose the css (this happened before this PR). I'm going to investigate this as I'm sure it's something our side but thought I'd mention it in case you had any ideas? Might be more to do with html2canvas I suspect. Thanks for your help. Do you need anything from me? |
Well if you have bug reports, than supplying them would be neat. I talked with MrRio and we plan the new release for next week. So anything what can be fixed now... |
I close this issue, because it is "fixed". If you have separate bugs, please open a new issue. |
current version of html2canvas is 1.0.0-alpha.10 . how do you use html2canvas? |
Correct. The version inside the previous jsPDF min file was 0.5.0-beta-3. They’ve made it AMD-compliant in the new one. I use it to turn the html into a canvas element, I then convert that to an image with dataToUrl and then add the image to the pdf with jsPDF. |
Hi, Can you please tell me when will this issue be fixed? and What's the work - around for now? Cheers, |
I will update addHTML to recent html2canvas for jsPDF 1.4.2 Anonymous calls seem to be not complained anymore. |
Which commit fixed this? I've gone through the repo's history and can not find where this is fixed |
Well, I am not a robot :D. Working now a bunch of heavy duty ToDos. |
This issue was resolved in March 2014 (Issue #122 ) but it resurfaced after a commit in 2016.
As per my understanding require.js doesn't load libraries with multiple defines properly and hence the error.
I tried going back to older version of jspdf but latest autoTable version fails with that.
I am using jspdf 1.3.2 and autotable 2.1.0
Can you please fix this?
The text was updated successfully, but these errors were encountered: