Calling POS shopify.cart.setCustomer with a non-existing id leads to an uncaught exception in the native POS code.
Example snippet:
try {
console.log("Calling setCustomer")
await shopify.cart.setCustomer({
id: 1,
});
} catch (e) {
console.error("setCustomer exception caught")
}
In the dev tools console I can see that “Calling setCustomer“ is printed, but “setCustomer exception caught“ isn’t. Instead of the expected error, I see this exception
load.html:10 Uncaught (in promise) Error: Customer not found - id: 1
at construct (native)
at apply (native)
at _construct (address at index.android.bundle:1:650692)
at Wrapper (address at index.android.bundle:1:650344)
at construct (native)
at _callSuper (address at index.android.bundle:1:2419705)
at POSError (address at index.android.bundle:1:2419958)
at construct (native)
at _callSuper (address at index.android.bundle:1:5672019)
at CustomerNotFoundError (address at index.android.bundle:1:5672344)
at ?anon_0_ (address at index.android.bundle:1:5658726)
at next (native)
at asyncGeneratorStep (address at index.android.bundle:1:1130157)
at _next (address at index.android.bundle:1:1130415)
at callReaction (address at index.android.bundle:1:553154)
at anonymous (address at index.android.bundle:1:553420)
at flush (address at index.android.bundle:1:558771)
at tryCallOne (address at InternalBytecode.js:1:1180)
at anonymous (address at InternalBytecode.js:1:1874)
This works fine on version 2025-07, but not 2026-01.
NOTE: while I can only inspect this error on Android, I see the same symptoms on my iPad.
For context, my app enables merchants to add customers to the POS cart by scanning their barcode. The majority of merchants use barcodes issued by the app. Such barcodes have customer IDs encoded. However, some merchants issue their own barcodes. Currently, in production, the app calls setCustomer, and if it throws, then the app falls back to its database lookup.
I’d like to avoid fetching the customer ID via the Shopify admin API before calling shopify.cart.setCustomer, as it would be an additional redundant request. The code in shopify.cart.setCustomer already checks if the customer exists.
Would it be possible to get this fixed in version 2026-04?