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

Bug: Error when interpreters run before reference instantiation #438

Open
thantos opened this issue Aug 25, 2022 · 0 comments
Open

Bug: Error when interpreters run before reference instantiation #438

thantos opened this issue Aug 25, 2022 · 0 comments

Comments

@thantos
Copy link
Collaborator

thantos commented Aug 25, 2022

ReferenceError: Cannot access 'chargeCard' before initialization
at ReferenceExpr.ref (/home/sussmans/functionless/test-app/src/order-processing-queue.ts:404:37)

// use a Standard Step Function to orchestrate order fulfillment
const processOrder = new StepFunction(
  stack,
  "ProcessOrder",
  async (order: OrderPlacedEvent) => {
    await chargeCard(order);
    await dispatchOrder(order);
  }
);

const chargeCard = new Function(
  stack,
  "PlaceOrder",
  async (order: OrderPlacedEvent) => {
    console.log("Card Charged! (not)", order);
  }
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant