NetworkAccessDeniedError: permission to use fetch in checkout ui extension

NetworkAccessDeniedError: permission to use fetch in checkout ui extension

moshiurse
Shopify Partner
5 0 0

I have created a Shopify checkout extension. 

I cannot hit any API it's showing permission denied.
But I already added network_access = true to 'shopify.ui.extension.toml' file.

[extensions.capabilities]
api_access = true
network_access = true
block_progress = true

 

even from my app setting, I allow network access in checkout UI extension.

 

 

The error currently showing : 

 

Uncaught (in promise) NetworkAccessDeniedError: permission to use fetch() must be specified under [capabilities] with flag "network_access = true"; this can be done within your extension's configuration. View the docs for more information:

2023-08-24_16-52.png

 

Is there anything more needed?

Whats the problem ?

Apps developer
Replies 6 (6)

lizk
Shopify Staff
246 58 74

Hi 👋

I just want to confirm that you restarted your development server after updating the configuration file?

To learn more visit the Shopify Help Center or the Community Blog.

moshiurse
Shopify Partner
5 0 0

Yes. I restarted so many times after updating toml file.

Apps developer
Tom_Hooker
Shopify Expert
84 4 12

Same issue if you have fixed this please let me know. Thanks

On The Road Shopify Agency
Helping Shopify stores to become greater with purpose behind design.
info@ontheroaduk.co.uk
http://ontheroaduk.co.uk/
Kostya_Miliev
Shopify Partner
1 0 0

You should additionally allow network access at the app API access page

 

Shopify+Partners+2023-12-18+1+PM-41-28.png

yedla_dinesh
Shopify Partner
11 0 1

I have approved "network access in checkout UI extensions," but I am still facing the same issue. I'm fed up. Now, I'll try with metafields.

Note: Retrieving data from metafields during checkout is faster since it won't introduce an external network call. This allows you to rely on Shopify for the uptime, scaling, and durability of the data storage.

Shopify Expert
Helping thousands of @Shopify store owners to achieve sustainable growth & increase revenue 2-3x 
st_consult
Shopify Partner
17 1 3

That was missing in my case. Fetching stuff from an external backend worked after I set this.
Thanks a lot!