diff --git a/src/fetch.ts b/src/fetch.ts index cdf6502..e020a5a 100644 --- a/src/fetch.ts +++ b/src/fetch.ts @@ -61,7 +61,10 @@ export function createFetch ({ fetch }: CreateFetchOptions): $Fetch { // Throw normalized error const err = createFetchError(request, error, response) - Error.captureStackTrace(err, $fetchRaw) + // Only available on V8 based runtimes (https://v8.dev/docs/stack-trace-api) + if (Error.captureStackTrace) { + Error.captureStackTrace(err, $fetchRaw) + } throw err }