[Bug]: POS Extension Fetch Bug

I believe there is a bug in wrapped fetch on POS. If you return a 204 status code with no body you get an error which you can’t catch as it’s in the post message.

data:text/javascript…D)%3B%7D)()%3B%0A:1 
 Uncaught TypeError: Failed to construct 'Response': Response with null body status cannot have body
    at MessagePort.<anonymous>

Still there as of 2025 August. Admiiin! :laughing:

(Btw I’m pretty sure it used to work before too xd)

@JordanFinners @kudze

To help us investigate further, could you provide the following details?

  • The exact (or similar) code snippet where you’re using wrapped fetch and returning the 204 response.
  • The version of POS or the environment where you’re seeing this.
  • Any relevant logs or stack traces (beyond what you’ve already shared).
  • Steps to reproduce the issue, if possible.

This information will help us pinpoint the root cause and determine the best fix. Thanks!

Yeah of course.

The code I’m using to response is just a standard HTTP Response: new Response(null, {status: 204})

Looks like its still happening on the latest version
POS 10.8.1 on Android
UI Extension version 2025-07

Make a POST request from Shopify POS using fetch, to your API endpoint which returns at 204 with no body.
The wrapper you have around fetch throws an error because it can’t handle the empty body.

1 Like

Just wanted to notify that I discovered this issue in Admin UI extensions too.

I set up small script in my homelab that you could use for testing.
To trigger the issue you can use something as simple as:

fetch('https://test.kudze.lt').then(() => console.log('ok'));

The ok will never be printed and the error will look something like this:
image

Expected output should be something like this:
image

@JordanFinners @kudze We’ve deployed a fix. If you run into any problems, please let us know. Thank you.

1 Like

Thank you, just tested it and works for me. TYVM!

1 Like

Thanks for reporting and for helping us resolve this :raising_hands: