generator-gulp-angular icon indicating copy to clipboard operation
generator-gulp-angular copied to clipboard

Uncaught TypeError: (intermediate value)(intermediate value)(...) is not a function

Open jordic opened this issue 9 years ago • 6 comments

Under development all works fine, but when I try to build the source, I got this error.

I added backbone, and underscore as dependencies.

Any tip, where I can statrt debugging?

jordic avatar Dec 07 '15 14:12 jordic

What I found: Partials are not generated between a closure, and on initilialitzation there is a race, they try to register on module, but this is still not created, for solving this, I edited, gulp/build,js task partials:

.pipe($.angularTemplatecache('templateCacheHtml.js', {
  module: 'mnt',
  root: 'app',
  templateHeader: '(function() { angular.module("<%= module %>"<%= standalone %>).run(["$templateCache", function($templateCache) {',
 templateFooter: '}]);})();'
}))

Added: (function(){ (templatecode) ;})() Also I found that all generated code within closures, must end with ; If not, build, failes to execute.

jordic avatar Dec 08 '15 05:12 jordic

You really give not enough info. What options, what fails in generating partials? If the partials task fail, there is no way the bundle could work.

Swiip avatar Dec 09 '15 07:12 Swiip

It's not the partials failing... the partials works... but the generated app.js... on the templatecache, has no proper closure, and when the browser parses the file, as its trying to inject templatecache, in a uninitalized module, it fails.. Adding, the closure to the templateHeader, and templateFooter, makes it work.

jordic avatar Dec 09 '15 07:12 jordic

I have the same problem. May I know how did you solve this problem please.

Where should I add "(function(){ (templatecode) ;})()"

samskrithib avatar Nov 30 '16 12:11 samskrithib

Meet same problem.

dingguijin avatar Mar 03 '17 04:03 dingguijin

I had the same problem, to solve this, make sure to add ';' at the end of each (function(){ (templatecode) ;})();

raslasarslas avatar Nov 29 '17 21:11 raslasarslas