Evert
Evert

Reputation: 99523

Firefox is blocking fetch requests on same origin

I'm a little stumped with this one, I'm making a request in firefox to a relative url:

await fetch('/foo/bar',{});

This errors out with:

TypeError: NetworkError when attempting to fetch resource.

Furthermore, the urls show up as 'blocked' in the network tab:

enter image description here

Things I've checked:

Upvotes: 0

Views: 1168

Answers (1)

Evert
Evert

Reputation: 99523

I figured out the issue.

  1. The fetch() request was initiated.
  2. An unrelated error was thrown.
  3. This error was not checked correctly, causing the browser to redirect to a different url.
  4. This redirect caused the (still running) fetch request to abort.
  5. The aborted request shows up as a block, setting me on an incorrect path to try and fix this.

So things were broken, just not where I expected. Thank you for helping me think and find the root cause

Upvotes: 3

Related Questions