Menu

Showing posts with label Body used already. Show all posts
Showing posts with label Body used already. Show all posts

TypeError: body used already for url

Error: TypeError: body used already for endpoint url

The reason of this issue is, uses of statement response (e.g. reposne.json()) more than once. If we already use response body statment for reading the response data and try to use again response.json() statement anywhere else or in then function.

Solution: Create a variable and assign the fetch response into that variable as a value to further use. This way we need to call the response.json() statment only once.