im using the EventBus construct, am getting an err...
# help
a
im using the EventBus construct, am getting an error about the node env
Copy code
3. node_modules/@serverless-stack/node/config/index.js (63, 6) - Top-level await is not available in the configured target environment ("node14")
Copy code
new sst.EventBus(props.stack, "bus", {
    rules: {
      plaid_hook: {
        eventPattern: { source: ["plaid.hook"] },
        targets: ["core/connection/plaid.sync"],
      },
    },
  });
I can invoke the event in the console but am getting this error when invoking:
Copy code
✘ [ERROR] Top-level await is not available in the configured target environment ("node14")

    node_modules/@serverless-stack/node/config/index.js:63:6:
      63 │     : await load();
         ╵       ~~~~~
Copy code
export async function sync() {
  return JSON.stringify({ some: "data" });
}
t
need to set bundle.format = "esm" on the function
should set it as a default if it's not there
f
Yup, in ur
index.js/ts
, add this to the top of the
main
function
Copy code
app.setDefaultFunctionProps({
  bundle: {
    format: "esm",
  },
});