Resource picker in admin block

Topic summary

A developer is attempting to implement a product selection feature in an admin block targeting order details. They want to replicate the existing Shopify functionality for adding products to orders (via search or browse button).

Current Issue:

  • Successfully opens the resource picker modal using const selected = await shopify.resourcePicker({type: 'variant'});
  • Works correctly on a regular page
  • Throws an “Uncaught (in promise) TypeError: shopify.resourcePicker is not a function” error when called from within an Admin Block

Status: The issue remains unresolved, with the resource picker API behaving differently in the Admin Block context compared to standard admin pages.

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

I have an admin block that targets order-details where I would like the user to select a product. I would like this to be done just how you can add a product to an already created order while editing (via Search product to add or by clicking the browse button). I currently have a page in the admin where I call

“const selected = await shopify.resourcePicker({type: ‘variant’});”

which pops up the modal I am talking about, but if I do the same thing from within and Admin Block I get the error “Uncaught (in promise) TypeError: shopify.resourcePicker is not a function.”