yarricharY
Convex Community3y ago
22 replies
yarrichar

Error: Connection lost while action was in flight

I've just started to get the following error:
logging.js:39 Uncaught (in promise) Error: [CONVEX A(analytics:summary)] Connection lost while action was in flight
    at createError (logging.js:39:1)
    at BaseConvexClient.action (client.js:297:24)


Not sure what's causing it. Pretty sure I'm doing the right thing. Functions say they're ready / deployed ok.

React code:
    const fetchSummary = useAction(api.analytics2.analyticsSummary);

    useEffect(() => {
        fetchSummary({ mvpId: mvpId as Id<"mvp">, minDate: moment().subtract(24, "hours").date() })
            .then(result => {
                console.log("Analytics result: ", result);
            });
    }, []);


Convex code:
export const analyticsSummary = action({
    args: { mvpId: v.id("mvp"), minDate: v.number() },
    handler: async ({ auth, runQuery }, { mvpId, minDate }) => {
      return null;
    }
});
Was this page helpful?