Skip to content

Does not work with async await #25

Closed

Description

@jazzyarchitects

I have a file a.js:

TransactionRoutingLayer.handleDebit = async (detail, options) => {
    const { items, userId, referenceNumber } = details;
    const chargeableItem = await ChargeableItem.getMappingIds(items, options);
    return PendingDebit.createPendingDebitEntry({
          amount: chargeableItem.amount,
          userId,
          referenceNumber,
          displayReason: details.displayReason,
          chargeableItemId: chargeableItem.id,
        });
    );
  };

and b.js:

PendingDebit.createPendingDebitEntry = async (details, options) => {
    const cleanedDebitDetails = {
      amount: details.amount,
    };
    Globals.generateTrace({ details, options });
    return PendingDebit.create(cleanedDebitDetails, options);
  };

I get the stack trace only till the last await statement. In this case only till a.js return PendingDebit.createPendingDebitEntry. line only. I don't get stack trace of which function called TransactionRoutingLayer.handleDebit

Activity

  1. niemyjski commented on May 4, 2021

    @niemyjski
    Collaborator

    Is this still an issue? Would you mind submitting a pr for this?

  2. niemyjski commented on Apr 24, 2026

    @niemyjski
    Collaborator

    Hi @jazzyarchitects 👋

    Thanks for reporting this. This is worth revisiting — since Node 12+, V8 has --async-stack-traces enabled by default, which should improve async/await stack trace continuity. The module itself faithfully captures/parses whatever V8 provides.

    Could anyone on a recent Node version (20+ / 22+) confirm whether this is still an issue? If async frames are now showing up correctly, we can close this. If not, we'd appreciate a minimal repro with the current version so we can investigate further.

    Leaving this open for now pending verification.

  3. added 3 commits that reference this issue on May 2, 2026
  4. self-assigned this
    on May 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions