App reviews, troubleshooting, and recommendations
We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more
Hi,
I've been trying to access some metafield data inside a Customer Account UI Extension, however I'm finding it impossible no matter what I try. I have checkout extensions that use the same code to access metafields that work fine, however it seems they are not accessible within new customer accounts.
Here's my code:
import {
TextBlock,
reactExtension,
useMetafield,
} from "@shopify/ui-extensions-react/customer-account";
export default reactExtension(
"customer-account.order-index.block.render",
() => <Refer />
);
function Refer() {
const stuff = useMetafield({key: 'mykey', namespace: 'mynamespace'});
return (<TextBlock>Hello world</TextBlock>);
}
And this is the error that it's throwing:
Am I missing something? The documentation suggests that metafields are available, and the methods exist to access them.
Thanks 😀
Further investigation has concluded that Metafields are not available. Can the Shopify team give an indication if/when this may change?