···136 body = encodedArgs.data;
137 }
138139+ let decoded;
140+ try {
141+ decoded = await decodeReply(body, {});
142+ } catch (e: any) {
143+ let message;
144+ message =
145+ "React couldn't parse the request payload. " +
146+ "Try triggering a real action first and copying its payload format.";
147+ if (e?.message !== "Connection closed.") {
148+ message += "\n\n" + e.toString();
149+ }
150+ throw new Error(message);
151+ }
152 const args = Array.isArray(decoded) ? decoded : [decoded];
153 const result = await actionFn(...args);
154
+1-1
tests/actionerror.spec.ts
···112113 // Verify error message includes our helpful hint about payload format
114 const errorText = await errorEntry.innerText();
115- expect(errorText).toContain("couldn't parse the request payload");
116});
···112113 // Verify error message includes our helpful hint about payload format
114 const errorText = await errorEntry.innerText();
115+ expect(errorText).toContain("React couldn't parse the request payload");
116});