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
r.js error - Mismatched anonymous define() module: function () #289
Comments
I have the same problem. As a workaround I'm defining jspdf modules separately:
And in lib/jspdf.js:
With this configuration, requiring 'jsPDF' is enough. I'm even using almond and works fine. I'm still trying to find a workaround to the fact that bower will not install the whole repository, thanks to the "ignore" section of bower.json |
I've opened an issue in r.js asking which would be the best solution requirejs/r.js#699 |
With RequireJS it is needed to use the minimized version, as pointed in #122 |
Minimized version wouldn't help, in fact, I encountered issue there first. Presence of multiple anonymous |
@diegocr This happens with both debug and minified version. Using RequireJS was partially addressed in #122 . However, this problem arises when building an optimized version of an application that uses jsPDF. There should be a single anonymous define() in each file, see requirejs/almond#80 (comment) . For me it would be just fine to remove "jspdf.js" and "jspdf.plugin.*" from the ignore section of bower.json. This allows jspdf modules to be required separately as I previously described in this same issue. |
I'm still getting this error on the latest version of jsPDF. |
Getting this error by merely including the file as follows on a mostly blank page: "Error: Mismatched anonymous define() module: function" which seems to be from RequireJS. It does not happen when I include jspdf.min.js in the same way. |
+1, i've same problem with last version. |
There's an issue with r.js when using jsPDF. For more info, please read this comment: requirejs/r.js#558 (comment)
As I can tell, the
Is an issue, because you have https://github.com/MrRio/jsPDF/blob/master/dist/jspdf.debug.js#L1703-L1705, https://github.com/MrRio/jsPDF/blob/master/dist/jspdf.debug.js#L5673-L5675
https://github.com/MrRio/jsPDF/blob/master/dist/jspdf.debug.js#L5688
Assume that's an issue caused by build setup you're using.
The text was updated successfully, but these errors were encountered: