RangeError: Maximum call stack size exceeded

954 views
Skip to first unread message

Dan Cancro

unread,
Mar 24, 2015, 5:18:23 PM3/24/15
to ang...@googlegroups.com
Hi group,

I could use some help.  When running a build with gulp for the first time, I'm getting the error "RangeError: Maximum call stack size exceeded".  It looks like it has to do with gulp-minify-html but the files are js so I'm not really sure.  I'm new to gulp.

Any ideas?

Here's a jsfiddle of the gulpfile.js and below is the terminal output:


/usr/local/bin/node /usr/local/lib/node_modules/gulp/bin/gulp.js --color --gulpfile /Users/Dan/work/app/gulpfile.js build -v
[14:17:35] Using gulpfile ~/work/app/gulpfile.js
[14:17:35] Starting 'wiredep'...
[14:17:35] Wiring the bower dependencies into the html
[14:17:35] Starting 'clean-styles'...
[14:17:35] Cleaning: ./.tmp/**/*.css,./build/styles/**/*.css
[14:17:35] Starting 'vet'...
[14:17:35] Analyzing source with JSHint and JSCS
[14:17:36] Starting 'clean-code'...
[14:17:36] Cleaning: ./.tmp/**/*.js,./build/js/**/*.js,./build/**/*.html
[14:17:36] Starting 'clean-images'...
[14:17:36] Cleaning: ./build/images/**/*.*
[14:17:36] Starting 'clean-fonts'...
[14:17:36] Cleaning: ./build/fonts/**/*.*
[14:17:36] Finished 'clean-images' after 15 ms
[14:17:36] Starting 'images'...
[14:17:36] Compressing and copying images
[14:17:37] Finished 'clean-fonts' after 1.66 s
[14:17:37] Starting 'fonts'...
[14:17:37] Copying fonts
[14:17:37] gulp-imagemin: Minified 0 images (saved 0 B - 0%)
[14:17:37] Finished 'images' after 1.65 s
[14:17:37] Finished 'fonts' after 5.92 ms
[14:17:38] Finished 'clean-styles' after 2.97 s
[14:17:38] Starting 'styles'...
[14:17:38] Compiling Less --> CSS

/Users/Dan/work/app/client/app/app-start-spec.js
  line 8   col 20  'jasmine' is not defined.  (W117)
  line 36  col 24  'jasmine' is not defined.  (W117)
  line 69  col 9   'testFns' is not defined.  (W117)
  line 71  col 13  'toastr' is not defined.   (W117)
  line 72  col 20  'toastr' is not defined.   (W117)
  line 75  col 13  'toastr' is not defined.   (W117)
  line 76  col 20  'toastr' is not defined.   (W117)
  line 79  col 13  'toastr' is not defined.   (W117)
  line 80  col 20  'toastr' is not defined.   (W117)
  line 83  col 13  'toastr' is not defined.   (W117)
  line 84  col 20  'toastr' is not defined.   (W117)

  ⚠  11 warnings

[14:17:38] Finished 'styles' after 529 ms
[14:17:38] Finished 'clean-code' after 2.71 s
[14:17:38] Starting 'templatecache'...
[14:17:38] Creating an AngularJS $templateCache

/Users/Dan/work/app/client/app/app-start.js
  line 13  col 22  'factory' was used before it was defined.                           (W003)
  line 23  col 9   Inner functions should be listed at the top of the outer function.  (W026)
  line 23  col 24  'start' was used before it was defined.                             (W003)
  line 55  col 5   Possible strict violation.                                          (W040)

  ⚠  4 warnings

...

etc etc....

...


/Users/Dan/work/app/client/app/speaker/speaker-detail-controller.js
  line 11   col 27  'speakerdetail' was used before it was defined.                  (W003)
  line 13   col 18  Possible strict violation.                                       (W040)
  line 16   col 13  It's not necessary to initialize 'wipEntityKey' to 'undefined'.  (W080)
  line 32   col 25  'canSave' was used before it was defined.                        (W003)
  line 36   col 26  'activate' was used before it was defined.                       (W003)
  line 47   col 24  'cancel' was used before it was defined.                         (W003)
  line 74   col 53  Did you mean to return a conditional instead of an assignment?   (W093)
  line 87   col 24  'goBack' was used before it was defined.                         (W003)
  line 97   col 22  'save' was used before it was defined.                           (W003)
  line 112  col 30  Expected '{' and instead saw 'return'.                           (W116)
  line 98   col 38  '$q' is not defined.                                             (W117)
  line 81   col 30  'error' is defined but never used.                               (W098)
  line 90   col 72  'data' is defined but never used.                                (W098)
  line 90   col 65  'event' is defined but never used.                               (W098)
  line 102  col 32  'saveResult' is defined but never used.                          (W098)
  line 106  col 30  'error' is defined but never used.                               (W098)

  ⚠  16 warnings


/Users/Dan/work/app/node_modules/gulp-minify-html/node_modules/minimize/lib/helpers.js:119
    bool = ~list.redundant.indexOf(key);
                           ^
RangeError: Maximum call stack size exceeded

Process finished with exit code 8

Tandon, Rishi

unread,
Mar 25, 2015, 11:07:40 AM3/25/15
to ang...@googlegroups.com
There could be couple of things you can try:
1. Try segregating the check-style/ clean-style from the build process.
2. Try putting the debug on helpers.js and found out the max limit on list.redundant.

--
You received this message because you are subscribed to the Google Groups "AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to angular+u...@googlegroups.com.
To post to this group, send email to ang...@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.



--
Rishi Tandon
Pearson Learning Technology Group

Mobile: (310) 926-9032

Pearson
Always Learning
Learn more at www.pearson.com

Dan Cancro

unread,
Mar 25, 2015, 8:14:24 PM3/25/15
to ang...@googlegroups.com
I don't see a 'check-style' task, but I think I disabled the 'clean-styles' one and got the same results.

I don't entirely understand what's going on.  I commented a couple lines that I thought would disable things, like so...

gulp.task('inject', ['wiredep'
  //, 'styles'
  //, 'templatecache'
], function() {

but the output from gulp build looks thus, suggesting that it's still trying to run 'templatecache'

...

[19:33:32] Starting 'images'...
[19:33:32] Compressing and copying images
[19:33:34] Finished 'clean-fonts' after 1.56 s
[19:33:34] Starting 'fonts'...
[19:33:34] Copying fonts
[19:33:34] gulp-imagemin: Minified 0 images (saved 0 B - 0%)
[19:33:34] Finished 'images' after 1.55 s
[19:33:34] Finished 'fonts' after 6.07 ms

/Users/Dan/work/app/client/app/app-start-spec.js
  line 8   col 20  'jasmine' is not defined.  (W117)
  line 36  col 24  'jasmine' is not defined.  (W117)
  line 69  col 9   'testFns' is not defined.  (W117)
  line 71  col 13  'toastr' is not defined.   (W117)
  line 72  col 20  'toastr' is not defined.   (W117)
  line 75  col 13  'toastr' is not defined.   (W117)
  line 76  col 20  'toastr' is not defined.   (W117)
  line 79  col 13  'toastr' is not defined.   (W117)
  line 80  col 20  'toastr' is not defined.   (W117)
  line 83  col 13  'toastr' is not defined.   (W117)
  line 84  col 20  'toastr' is not defined.   (W117)

  ⚠  11 warnings

[19:33:34] Finished 'clean-code' after 2.14 s
[19:33:34] Starting 'templatecache'...
[19:33:34] Creating an AngularJS $templateCache

/Users/Dan/work/app/client/app/app-start.js
  line 13  col 22  'factory' was used before it was defined.                           (W003)
  line 23  col 9   Inner functions should be listed at the top of the outer function.  (W026)
  line 23  col 24  'start' was used before it was defined.                             (W003)
  line 55  col 5   Possible strict violation.                                          (W040)

  ⚠  4 warnings

...

/Users/Dan/work/app/node_modules/gulp-minify-html/node_modules/minimize/lib/helpers.js:34
  return value.replace(check, ' ');
               ^
RangeError: Maximum call stack size exceeded


Here's a map of my gulp tasks from WebStorm:

I'm not exactly sure what you mean by 'max limit of list.redundant'.  I don't see such a property of list.redundant

> list.redundant.toString()

autofocus,disabled,multiple,required,readonly,hidden,async,defer,formnovalidate,checked,scoped,reversed,selected,autoplay,controls,loop,muted,seamless,default,ismap,novalidate,open,typemustmatch,truespeed,itemscope,autocomplete


Tandon, Rishi

unread,
Mar 26, 2015, 9:34:59 AM3/26/15
to ang...@googlegroups.com
Hey Dan

From the initial error statement it seems that the data for the "value" used to compact/ minify is not appropriate at https://github.com/Moveo/minimize/blob/master/lib/helpers.js Line 32-35

I would recommend to segregate each gulp task and debug them individually.

The following link might help to debug the same:


Also, you can try replacing the minimize gulp module to something else: http://node-modules.com/search?q=minimize
And also check for the jshint errors if any.

Regards
Rishi

--
You received this message because you are subscribed to the Google Groups "AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to angular+u...@googlegroups.com.
To post to this group, send email to ang...@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages