POS Extension: Unable to make fetch() requests

Topic summary

A developer encountered a “Fetch failed” error when making API requests from a Shopify POS extension using @shopify/ui-extensions@2024.7.0 and @shopify/ui-extensions-react@2024.7.0.

Key Details:

  • The fetch() call to their server fails in production but works in development mode
  • The server doesn’t appear to receive the request at all
  • CORS settings are properly configured server-side with appropriate origins
  • The previous @shopify/retail-ui-extensions library worked without issues

Code Context:

  • Using useApi() hook to get session token
  • Making POST request with session token in Authorization header
  • Server configured with CORS middleware allowing Shopify CDN origins

Resolution:
The issue was resolved by fixing DNS server settings on the developer’s infrastructure side.

Summarized with AI on November 6. AI used: claude-sonnet-4-5-20250929.

Shopify POS library works as expected. I had to fix my server DNS settings.

1 Like