TypeError in Async Function: Missing [Symbol.iterator]() Method for Promise<Effect<Promise<unknow...

async function getsession(c: Context) {
  return Effect.gen(function* () {
    const cookie = yield* Effect.sync<string>(() => {
      return getCookie(c, "wos-session") as string;
    });
    if (cookie) {
      return unsealData(cookie, {
        password: process.env.WORKOS_COOKIE_PASSWORD as string,
      });
    }
  });
}
export async function withAuth(c: Context, next: Next) {
  return Effect.gen(function* () {
    const session = yield* getsession(c);
  });
}
Why I am getting Type 'Promise<Effect<Promise<unknown> | undefined, never, never>>' must have a '[Symbol.iterator]()' method that returns an iterator Error .
Was this page helpful?