-
-
Notifications
You must be signed in to change notification settings - Fork 298
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
Yeoman Generetor Crashes Because of endless recursion #350
Comments
I don't know if it solves your problem, but before each |
Hi, I would like to try this, but my generator looks bit different and I am not sure where should I put it in my case. Please, can you take a look at https://github.com/korczis/generator-the-scratch/blob/master/app/index.js and help me investigate if can I fix it on my own? |
@Volox I was the one that originally opened the issue on the chalk repo, I tried your suggestion but no luck still got the same error |
Any news? |
I wonder if this is a Windows issue, @korczis what OS are you using? |
It crashes on both - Linux Mint 64 bit in Virtual Box and Windows 7 64 Bit Ultimate. |
Btw, my generator is here: https://github.com/korczis/generator-the-scratch
And now you can run the generator
|
I'm also getting the following error when trying to copy over files and folders from a large directory within my generator. The first couple hundred copy over fine, but eventually breaks and includes this message:
|
Yep same error, I get it after ~486 files On Wed, Sep 11, 2013 at 9:04 AM, Aaron Bushnell notifications@github.comwrote:
Ing. Javier Villanueva |
I am having the same error, and was able to run the generator without this problem at |
For anyone else who is interested: v0.11.4...v0.12.0 |
2 hours and I managed to dig into some async.js code, maybe someone who has more familiarity with this code can figure it out. Currently I am going to keep my generator at |
Thaks for pointing the version out, I'll stick with 0.11.4 as well On Sat, Sep 14, 2013 at 3:24 PM, Wes Todd notifications@github.com wrote:
Ing. Javier Villanueva |
Hm, I'm changed my
but I'm still getting this error when running my
|
You probably need to reinstall the package it might still be referencing On Sat, Sep 14, 2013 at 11:08 PM, Aaron Bushnell
Ing. Javier Villanueva |
You need to get rid of the tilde. That says to install a compatible version. What you want is a specific version. |
That shouldn't matter, as I understand the tilde means to match v0.11.* so it'll fetch the 0.11.5 version (not sure if that one has the bug though) |
Using |
I've been able to reproduce replicating steps linked by @korczis here: #350 (comment) (on OSx) |
@sindresorhus I wonder if the solution on Yeoman side is to use Streams instead of sync read/write on each repo file. Streams auto regulate the amount of data they ingurgitate to prevent overflows, but I don't think this would really slowdown the speed of the logs... |
If streams would provide a more stable experience, why not? |
@SBoudrias i agree |
Streams would probably reduce the peak memory usage, but I am not sure that would fix this issue. And I am not sure how streaming template parsing works with underscore, so it might be difficult. |
@wesleytodd Yeah, that was my second though too. Although, I don't think large/bulk copying need processing. So maybe it'd be better to have two kind of copying, "on by one" (filter, processing) and "bulk" (just copy a full dir with 3000 files). (I checked around Grunt yesterday to see if they ever had similar issues, at it don't look like it) |
I found the fix. I am putting together the PR right now. It was the |
…revent maximum call stack error
Looks like it failed the tests, I probably should have ran them before submitting the PR, sorry. Let me see about that and I will update with whatever changes are necessary. |
@SBoudrias I like the idea of doing a "bulk" copy operation that does not check for conflicts or parse templates. I have a rough implementation of this by just adding a fourth parameter to the Would you guys rather have this api change, or a completely new method like |
I would vote for second option. One more point. Will not be also usefull have some white/black listing variant? Imagine the situation where one have large folder structure with tens of dirs and subdirs and wants to have only few of them processed by conflicter and engine. It will be nice to have posibility to pass input dir and list of files to have processed by engine. What do you think of it? |
@korczis Sorry, I was already in it on this method when I read your post. Maybe if anyone on the core team could chime in a say what they would like. It would only take a few minutes to port my PR over to a separate method instead of an extra parameter. |
Also experiencing this ... |
Added ability to skip processing on large directory copies. This circumvents the issue with the maximum call stack Updated new copy and directory methods to be separate Fixed tabs back to spaces Removed additional spaces Reccomended changes: moved directory method out and fixed formatting
@wesleytodd Thanks for making that commit! How can I implement this into my Yeoman generator? Got a bit of documentation on it? |
@aaronbushnell Check out #359. You could apply that patch on your version of yeoman-generator. But that is probably not recommended. I would either revert back to v0.11.4 for your project or just wait until that PR gets resolved and released to a new version of yeoman. |
Should be fixed with #359! |
I just updated the package but it looks like the directory method isn't running the new bulk copy function since I'm getting the same error, I changed my code to: 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('.', '.', false, true); // <-- Is it ok?
done();
});
}; Maybe I'm doing something wrong. |
You need to use the new methods,
|
Strange I'm getting a "TypeError: Object # has no method 'bulkDirectory'" error when I change it from |
Folks, may I ask you what the situation is now? |
@korczis There are two new methods from this PR: #359 The methods are https://github.com/yeoman/generator/blob/master/lib/actions/actions.js#L175 You use these just like you used to with the normal |
I'm trying to use the
|
@jahvi Ha, good catch. The methods were not added for the remote usage. I will add those and submit another PR. |
Hi all, I've fall for this too :( While the new
and as |
@wesleytodd I switched to your
Even though the target directory is empty, selecting "yes" copies the files just fine but I'm not sure why the conflict. |
@jahvi The new Is there a better way that you can think of to handle this? |
I think the issue here is that the |
@SBoudrias It would be pretty trivial to get the dir name when it is just a |
Yup, but I would like to reduce complexity to a minimum. And I don't think we should resolve every path as relative path are usually great for the display purpose. You can send a PR and we'll see if it is simple enough 👍 |
For anyone who is interested I ended up working around by using https://npmjs.org/package/ncp this.remote('wordpress', 'wordpress', '3.6', function (err, remote) {
if (err) {
cb(err);
}
ncp(remote.cachePath, path.join(site_url, 'wp'), function (err) {
if (err) {
return console.error(err);
}
cb();
});
}); Obviously |
@getdave Awesome module, thanks for coming with it. |
@wesleytodd Perfect. Thanks. 👍 |
Hi There,
I think latest version of yeoman generator has some bug which crashes it when some amout of files is exceeded. Me and one other githuber thought it is chalk.js issue, but we were wrong. Author of chalk did some investigation and pointed to generator.
Can you take a look please?
Origin (chalk.js) issues: chalk/chalk#4
The simpler test case I can think of is:
Run yo generator (let's say the generator is called "test")
Replace all prototype functions in app/index.js with:
Run yo test
The text was updated successfully, but these errors were encountered: