Skip to content

Exceeded the maximum call stack inside an async function leads to an uncaught promise, even if await is used properly #778

Description

@wryun

Running:

async function x() { 
    await x(); 
} 
(async function () { 
    try { 
        await x(); 
    } catch (e) { 
        console.log(e); 
    } 
})() 

Leads to an uncaught promise:

; node t.js
(node:434) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): RangeError: Maximum call stack size exceeded

Running the same thing with babel transpiling to bluebird coroutines works fine. I guess there are two questions?

  • is this a bug?
  • if it is a bug, should I be filing it against node or v8?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions