effect icon indicating copy to clipboard operation
effect copied to clipboard

From Discord: Issue with Effect Reading Request Body in Next.js Application

Open effect-bot opened this issue 9 months ago • 2 comments

Summary

A user is experiencing an issue with their Next.js application, specifically related to the Effect Typescript library reading the request body during server-side rendering (SSR). They provided an error message indicating a TypeError related to a detached ArrayBuffer when attempting to perform a POST request. The user mentioned this occurs when using the useSuspenseQuery hook to call an RPC endpoint. They also shared a GitHub repository with a standalone reproduction of the problem for further investigation.

Key takeaways:

  • The issue is linked with request handling during SSR in a Next.js application using Effect.
  • The error message suggests a problem with handling the response body, specifically regarding a detached ArrayBuffer.
  • The problem surfaces when making POST requests in the context of useSuspenseQuery.
  • A GitHub repository is available to reproduce and investigate the issue further.

Discord thread

https://discord.com/channels/795981131316985866/1354016822843801630

effect-bot avatar Mar 25 '25 17:03 effect-bot

repro here: https://github.com/titouancreach/repo-bug-rpc

titouancreach avatar Mar 25 '25 17:03 titouancreach

it works with the new version of RPC

titouancreach avatar Apr 01 '25 15:04 titouancreach