Hi I am using checout ui extension. And getting the this error - GET https://checkout-test-store-two.myshopify.com/private_access_tokens?id=3dfdf2e16cfc8a57c357df2d6aad5c3c&checkout_type=c1 net::ERR_ABORTED 401 (Unauthorized)
I am not using any api request in the app. In the checkout I am just displaying some cart item properties below which I am passing from product page.
code -
// extensions/installation-address-display/src/checkout.jsx
import {
reactExtension,
useCartLines,
BlockStack,
Heading,
Text,
Divider,
InlineLayout,
} from ‘@shopify/ui-extensions-react/checkout’;
const TARGET = ‘purchase.checkout.delivery-address.render-after’;
export default reactExtension(TARGET, () => {
// console.log(‘[App Extension] Rendering App component.’);
return ;
});
function App() {
// console.log(‘[App] Function component invoked.’);
const lines = useCartLines();
const installationProperties = ;
// console.log(‘[App] Cart lines:’, lines);
lines.forEach((line, lineIndex) => {
// console.log([App] Processing line ${lineIndex + 1}:, line);
line.attributes.forEach((attr, attrIndex) => {
// console.log([App] Line ${lineIndex + 1}, Attribute ${attrIndex + 1}:, attr);
if (attr.key.startsWith('_Installation ')) {
// console.log([App] Found installation attribute: Key: ${attr.key}, Value: ${attr.value});
if (!installationProperties.find(p => p.key === attr.key && p.value === attr.value)) {
installationProperties.push({ key: attr.key, value: attr.value });
// console.log([App] Added to installationProperties:, { key: attr.key, value: attr.value });
} else {
// console.log([App] Duplicate installation attribute found, not adding: Key: ${attr.key}, Value: ${attr.value});
}
}
});
});
// console.log(‘[App] Compiled installationProperties:’, installationProperties);
if (installationProperties.length === 0) {
// console.log(‘[App] No installation properties found. Rendering null.’);
return null;
}
// console.log(‘[App] Rendering Installation Address UI with properties:’, installationProperties);
return (
Installation Address
{installationProperties.map(({ key, value }, index) => {
// console.log([App] Mapping installation property ${index + 1}: Key: ${key}, Value: ${value});
return (
<InlineLayout key={${key}-${index}} columns={[‘auto’, ‘fill’]} spacing=“base”>
{key.replace(‘Installation ‘, ‘’).replace(’’, ‘’)}:
{value}
);
})}
);
}
Screenshot also attached - (Installation address)