mattgoldspink / grunt-sencha-dependencies

Grunt task to get the list of Ext.require dependencies in your application
MIT License
32 stars 22 forks source link

Error: TypeError: Cannot read property 'nameToAliasesMap' of undefined with Sencha 2.0 #14

Closed cburgdorf closed 11 years ago

cburgdorf commented 11 years ago

When I try to get it to work to run with ST 2.0 I get the following error:

`TypeError: Cannot read property 'nameToAliasesMap' of undefined``

It happens here:

SenchaDependencyChecker.prototype.safelyEvalFile = function(fileUrl) {
  if (!grunt.file.exists(fileUrl)) {
    grunt.log.error('Source file "' + fileUrl + '" not found.');
  }
  try {
      //BOOOOOOOOOOOOOOOOOOOM
      //the file can be read (so the path is correct)
      //but on the eval it throws the error.
      // the file being eval'ed is the sencha-touch-debug.js
      eval(grunt.file.read(fileUrl));
  } catch (e) {
      grunt.log.error("An unexpected error occured while processing " + fileUrl + ", please report a bug here if problems occur in your app " +
                  "https://github.com/mattgoldspink/grunt-sencha-dependencies/issues?state=open - " + e);
      if (e.stack) {
          grunt.log.error("Stack for debugging: \n" + e.stack);
      }
      throw e;
  }
  return Ext;
};
mattgoldspink commented 11 years ago

@cburgdorf I've just pushed a new version to NPM (0.3.1) I quickly tested a 2.0.1 example (touchtweets) and I don't get any errors when eval'ing the sencha-touch-debug.js file. Can you try upgrading to the newer code?

In addition there are now too mode's for figuring out the dependencies. It's probably worth trying both modes. See https://github.com/mattgoldspink/grunt-sencha-dependencies#optionsmode for details