requirejs patch for anonymous define() #310

merged 1 commit into from Jul 17, 2014


None yet
3 participants

vuongdothanhhuy commented Jul 16, 2014

This is the patch for my posted issue at: #309

I tried using jsPDF (.debug.js and .min.js) with RequireJS (2.1.11). Everything works fine until I use grunt to build my webapp. After minification, my webapp break with error:



I found a workaround to this problem, by specifying what is called a stringID for that define() function:

define('jsPDF', function(){
    return jsPDF;

diegocr commented Jul 17, 2014

Merging, and assuming this wouldn't cause a conflict for users using this approach.


diegocr added a commit that referenced this pull request Jul 17, 2014

Merge pull request #310 from vuongdothanhhuy/requirejs-patch
requirejs patch for anonymous define() - closes #288

@diegocr diegocr merged commit 8fb976e into MrRio:master Jul 17, 2014

This patch seems to have broken the ability to requirejs in the file. When I require in the latest version I get undefined however if I revert this change everything loads ok. Have you got any ideas? I know you are just naming the module so strange the impact it has had.


vuongdothanhhuy replied Feb 6, 2015

Hi @metaman,
Thank you for your feedback. I'm also quite surprise how could one very simple and legal change can result in undefined in the latest requirejs. I will look into it as soon as I have time. Meanwhile, it would be very welcome if anyone can come and help us! (especially those who master AMD/requirejs).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment