I get this error, along with the long list of plugins error, several times. I am in alpha testing and trying to get rid of a couple of bugs, so i may build several times a day.
Steps i take:
If i get the 'undefined error' i just close XDK and re-open. I'll usually get the big error box that lists my plugins. I'll just click on any of the bottom buttons so it closes.
Once on the project page, where you add the settings for your build, i always delete my third party plugins i have added in C2 (the only plugins i use at this time are from cranberrygame: cordovaGame, cordovaAdmob and cordovaIAP. Why? I have had several errors when building if i leave them in. So it wastes less time for me to delete them and add them again manually.
Also, when i edit my game, layouts or event sheets, i always change the version number: 1.0.0.6, 1.0.0.7, etc.etc.
When i do this, if i try to open that project in intel xdk, i'll get an error sometimes. So i always delete that previous project from intel xdk, which does not delete it from your hard drive, only from intel xdk's. I have to sometimes close/re-open and delete it again, but it does save some headaches.