You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In fetch.ts on line 64 (https://github.com/unjs/ohmyfetch/blob/main/src/fetch.ts#L64), called when an error occurs during the fetch, a call is made to Error.captureStackTrace. This is a non-standard, V8-specific function that appears to work in Chrome and Nodejs, but does not work in Firefox.
This means that all error-handling is broken when using the Firefox browser, as my user code can no longer receive a FetchError if an issue occurs, but always receives this TypeError (without any of the information, such as response body).
Essentially, this makes ohmyfetch unusable in production code that supports the Firefox browser, or any non-Chromium-based browser.
I would also note that other projects have dealt with this issue by using Error().stack in some fashion - here is an example from 2015: trentm/node-bunyan#224
Please can this issue be resolved as a priority as, again, in its current form this otherwise helpful library cannot be used in general production scenarios.
The text was updated successfully, but these errors were encountered:
Having looked at a few other libraries (including TailwindCSS and HeadlessUI), it seems that this is often fixed by wrapping the call to Error.captureStackTrace in an existence-check. I've created a PR with this change, that should cause no conflicts (only a single line is changed).
In
fetch.ts
on line 64 (https://github.com/unjs/ohmyfetch/blob/main/src/fetch.ts#L64), called when an error occurs during the fetch, a call is made toError.captureStackTrace
. This is a non-standard, V8-specific function that appears to work in Chrome and Nodejs, but does not work in Firefox.This means that all error-handling is broken when using the Firefox browser, as my user code can no longer receive a FetchError if an issue occurs, but always receives this TypeError (without any of the information, such as response body).
Essentially, this makes ohmyfetch unusable in production code that supports the Firefox browser, or any non-Chromium-based browser.
I would also note that other projects have dealt with this issue by using
Error().stack
in some fashion - here is an example from 2015: trentm/node-bunyan#224Please can this issue be resolved as a priority as, again, in its current form this otherwise helpful library cannot be used in general production scenarios.
The text was updated successfully, but these errors were encountered: