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. #94

Open
ghost opened this issue Jun 10, 2017 · 6 comments
Open

Maximum call stack size exceeded. #94

ghost opened this issue Jun 10, 2017 · 6 comments

Comments

@ghost
Copy link

ghost commented Jun 10, 2017

OS: Debian 8 x64
Node: v8.1.0
NPM: v5.0.3

Receiving this error:

RangeError: Maximum call stack size exceeded
    at emitOne (events.js:113:17)
    at ChildProcess.emit (events.js:210:7)
    at emitOne (events.js:115:13)
    at ChildProcess.emit (events.js:210:7)
    at emitOne (events.js:115:13)
    at ChildProcess.emit (events.js:210:7)
    at emitOne (events.js:115:13)
    at ChildProcess.emit (events.js:210:7)
    at emitOne (events.js:115:13)
    at ChildProcess.emit (events.js:210:7)

With this code:

const express = require('express');
const ydl = require('youtube-dl');
const gifify = require('gifify');
const fs = require('fs');

const app = express();
app.listen(80);

const video = ydl('https://www.youtube.com/watch?v=o-qK3u97iB0');

app.get('/', (req, res) => {
	gifify(video, { fps: 29.97 }).pipe(res);
});
@Beanow
Copy link

Beanow commented Jun 11, 2017

Same issue v2.4.0 gifify with giflossy.
Ubuntu 16.04 based, node v6.9.4, npm 3.10.10

@Beanow
Copy link

Beanow commented Jun 11, 2017

I think the error is due to:
https://github.com/vvo/gifify/blob/master/index.js#L49

  [ffmpeg, convert, gifsicle].forEach(function handleErrors(child) {
    child.on('error', gifsicle.emit.bind(gifsicle, 'error'));
    //...
  });

The gifsicle error event, would emit another gifsicle error.

@vvo
Copy link
Owner

vvo commented Jun 13, 2017

Any of you can try to fix this? I am not yet using node v8.

@Beanow
Copy link

Beanow commented Jun 13, 2017

It's not v8 specific. Whenever the gifsicle object emits an error, you get an infinite loop of emitting more errors. You need to handle gifsicle's error events differently and it will fix this issue. What the error was that gifsicle emitted is a different issue.

@vvo
Copy link
Owner

vvo commented Jun 13, 2017

Taking PRs to solve this.

@Beanow
Copy link

Beanow commented Jun 13, 2017

I'll pass since I haven't looked into it enough to see how you want error handling to work. I just butchered it to find my underlying problem was #95, but it could be a different problem for @UNST4BL3

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