-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Description
Is there an existing issue for this?
- I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues
- I have reviewed the documentation https://docs.sentry.io/
- I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/vue
SDK Version
8.22.0
Framework Version
Vue 3.4.35
Link to Sentry event
No response
Reproduction Example/SDK Setup
Unfortunately I don't have a reproduction, but this is our setup:
- Vue SPA with useFetch for handling network requests
- Our repository: @digitalservicebund/ris-norms
- Sentry init: main.ts
- useFetch setup: apiService.ts
(Note that I debugged useFetch and it seems to not be a useFetch issue, see Steps to Reproduce below)
Steps to Reproduce
Summary: for some long-running (a few seconds, but <10s), fetch resolves before the actual request has finished. This leads to the fetch response being undefined. Anything accessing properties of the response then crashes. Reverting to @sentry/vue v8.20.0 fixes the issue.
Example:
fetch("some-long-running-request").then((response) => {
// Now response is sometimes undefined, so the following would lead to a TypeError:
if (response.status === 400) {
// ...
}
})Looking at the network dev tools and server logs, I can verify that the request is fulfilled successfully. However it seems that fetch resolves before the request has finished, with undefined as the value for the response.
Possibly related:
- feat(core): Adapt spans for client-side fetch to streaming responses #12723
- rewrite of fetch is not exact #11466 (open but refers to an older version)
Expected Result
Fetch should not resolve before the request is finished, and response should not be undefined.
Actual Result
Fetch resolves before the request has finished, response is undefined, and accessing properties of the response causes errors.
Metadata
Metadata
Assignees
Labels
Projects
Status