Have your say in Community Polls: What was/is your greatest motivation to start your own business?
Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Named export 'Provider' not found on @shopify/app-bridge-react

Solved

Named export 'Provider' not found on @shopify/app-bridge-react

bandini
Shopify Partner
9 0 0

Hey guys,

 

I'm still trying to sort out how functions work and how to avoid any manual interaction to set the app up.

 

I followed the tutorial here 

https://shopify.dev/docs/apps/selling-strategies/discounts/experience/ui

 

And when I run the app I get

 

[vite] Named export 'Provider' not found. The requested module '@shopify/app-bridge-react' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:

import pkg from '@shopify/app-bridge-react';
const {Provider} = pkg;

 

Implementing the solution o on the error message itself, makes it run, but leads to two console error which I suspect is the reason why nothing happens when I create a discount and click safe

 

 

 

app.tsx:11 Uncaught TypeError: Cannot destructure property 'Provider' of 'pkg' as it is undefined.
at app.tsx:11:9

 

 

Any idea on how I could debug this? I can't also debug the clicks on the discount modal itself 

Accepted Solution (1)

AdnanAhmed
Shopify Partner
2 1 2

This is an accepted solution.

I had the same issue, I removed the current installed latest(4.1) package and reinstall it using "npm install @Shopify/app-bridge-react@3.2.5", it solved my problem

View solution in original post

Reply 1 (1)

AdnanAhmed
Shopify Partner
2 1 2

This is an accepted solution.

I had the same issue, I removed the current installed latest(4.1) package and reinstall it using "npm install @Shopify/app-bridge-react@3.2.5", it solved my problem