Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maximum call stack size exceeded using yeoman remote #4

Closed
jahvi opened this issue Aug 29, 2013 · 6 comments
Closed

Maximum call stack size exceeded using yeoman remote #4

jahvi opened this issue Aug 29, 2013 · 6 comments

Comments

@jahvi
Copy link

jahvi commented Aug 29, 2013

I'm trying to fetch the latest files from the wordpress repo using a yeoman generator, the function looks something like this:

WpGenerator.prototype.getWordpress = function getWordpress() {
    var done = this.async();

    this.log.writeln('Getting WordPress v' + this.wpVersion);

    this.remote('wordpress', 'wordpress', this.wpVersion, function (err, remote) {
        if (err) {
            done(err);
        }
        remote.directory('.', '.');
        done();
    });
};

However half way through the copy process I get this error:

c:\Users\Jahvi\AppData\Roaming\npm\node_modules\yo\node_modules\chalk\chalk.js:30
var obj = defineProps(function self(str) {
RangeError: Maximum call stack size exceeded

I guess there's some sort of recursion going on that's hitting the max call stack size since there are so many files to copy? Not sure if it's an error with yeoman.

@korczis
Copy link

korczis commented Aug 31, 2013

I am experiencing this too. It has some problems coloring large list because of that recursion.

@korczis
Copy link

korczis commented Aug 31, 2013

Btw in my case it crashes after 457 files.

@sindresorhus
Copy link
Member

Would any of you mind posting a complete test case demonstrating the problem?

@jahvi
Copy link
Author

jahvi commented Aug 31, 2013

The simpler test case I can think of is:

  1. Run yo generator (let's say the generator is called "test")
  2. Replace all prototype functions in app/index.js with:
TestGenerator.prototype.getWp = function getWp() {
  var done = this.async();

    this.log.writeln('Getting WordPress v3.6');

    this.remote('wordpress', 'wordpress', '3.6', function (err, remote) {
        if (err) {
            done(err);
        }
        remote.directory('.', '.');
        done();
    });
};
  1. Run yo test

I get the error after ~486 files

PD: I'm running Win7 64bits if that helps

@sindresorhus
Copy link
Member

Tried your test case. I'm pretty sure the problem is not in Chalk, as I also got call stack error in mkdirp. Looks like there is some endless recursion in the generator system. Probably with action.copy().

/Users/sindresorhus/dev/generator-generator/node_modules/yeoman-generator/node_modules/mkdirp/index.js:74
                    throw err0;
                          ^
RangeError: Maximum call stack size exceeded

Mind opening up a ticket over at https://github.com/yeoman/generator/ ?

@korczis
Copy link

korczis commented Sep 3, 2013

Sorry for bothering you. I did opened yeoman/generator ticket: yeoman/generator#350

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants