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

Error on Q.defer() in node v0.12.0 using Q 1.1.2 #647

Open
dhartunian opened this issue Feb 16, 2015 · 1 comment
Open

Error on Q.defer() in node v0.12.0 using Q 1.1.2 #647

dhartunian opened this issue Feb 16, 2015 · 1 comment

Comments

@dhartunian
Copy link

When calling Q.defer() using node 0.12.0 I got the following error msg:

[TypeError: Function.prototype.apply: Arguments list has wrong type] __cached_trace__: [ {}, {}, {}, {}, {}, {}, {}, {}, {} ] }
Function.defer (/Users/davidh/repo/services/Frackend/node_modules/q/q.js:550:30)

The line in question is in this part of the defer method when the promise.stack is set. Let me know if you need more info.

if (Q.longStackSupport && hasStacks) {
    try {
        throw new Error();
    } catch (e) {
        // NOTE: don't try to use `Error.captureStackTrace` or transfer the
        // accessor around; that causes memory leaks as per GH-111. Just
        // reify the stack trace as a string ASAP.
        //
        // At the same time, cut off the first line; it's always just
        // "[object Promise]\n", as per the `toString`.
        promise.stack = e.stack.substring(e.stack.indexOf("\n") + 1);
    }
}

Here's a link to the line in question: https://github.com/kriskowal/q/blob/v1/q.js#L550

@dhartunian
Copy link
Author

When I downgraded to the previous node version that was available via brew: v0.10.36, the problem went away.

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

1 participant