#Failed to parse URL, but API still gets called and responds?

4 messages · Page 1 of 1 (latest)

heady flax
#
async function apiCall (data:FormData) {
    return (await fetch ("/api/apiOperations", {
        method: 'POST',
        body: data
    }))
}```

Gives me the error 
```⨯ unhandledRejection: TypeError: Failed to parse URL from /api/apiOperations
    at node:internal/deps/undici/undici:12502:13 {
  [cause]: TypeError: Invalid URL
[...]
at async apiCall (webpack-internal:///(ssr)/./app/apiAccess.tsx:105:12)```

but the API still triggers and returns data as expected. What's causing the random error message?
#

This is running on client-side

covert gull
#

are you sure this is client side stuff?

#

I see "ssr" being mentionned, as well as some references to nodejs in the stackstrace (at node:internal/deps/undici/undici:12502:)