Comments (1)
Hi there, @Martin86Ec!
After replacing the <AppProvider> tag in Volumes/new.jsx with a <div> tag, the error stops.
I think the issue you are having is a result of having <AppProvider>
in Volumes/new.jsx
.
I followed along the steps from https://shopify.dev/apps/discounts/create up to the end of Step 2 and didn't see any issues.
You should have a DiscountProvider.jsx
in frontend/components/providers
import { AppProvider } from '@shopify/discount-app-components'
import '@shopify/discount-app-components/build/esm/styles.css'
export function DiscountProvider({ children }) {
return <AppProvider locale="en-US" ianaTimezone="America/Toronto">{children}</AppProvider>
}
as well as this line in frontend/components/providers/index.js
after the other exports
export { DiscountProvider } from './DiscountProvider'
and then you should have
import {
AppBridgeProvider,
QueryProvider,
PolarisProvider,
DiscountProvider
} from "./components";
in frontend/App.jsx
and then you will want that provider you created to wrap the children there, so it might look like:
return (
<PolarisProvider>
<BrowserRouter>
<AppBridgeProvider>
<DiscountProvider> {/** here*/}
<QueryProvider>
<NavigationMenu
navigationLinks={[
{
label: "Page name",
destination: "/pagename",
},
]}
/>
<Routes pages={pages} />
</QueryProvider>
</DiscountProvider> {/** here*/}
</AppBridgeProvider>
</BrowserRouter>
</PolarisProvider>
);
Following step 2 in the Volumes/new.jsx
will get you the new discount page, you shouldn't have any AppProviders
in there. If you just copy the code from that page as is, it should display everything without issue.
I ran through this with the same npm/node/yarn versions as you and everything seemed to work.
Please feel free to reach out again if you have further issues!
from discount-app-components.
Related Issues (20)
- [FEATURE] Copy to clipboard button in SumaryCard HOT 1
- [FEATURE] Applies to section
- [FEATURE] Value card
- ⚙️ [CI] Version Packages is not picking up new commits HOT 1
- 🐛[Bug] MethodCard & others have no padding since v1.3.0
- 🐛[Bug] Module doesn't support Polaris version 12 HOT 2
- [FEATURE] add strategy all to DiscountApplicationStrategyCard
- 🐛[Bug] Support for `@shopify/app-bridge-react` V4 HOT 22
- [How to use] Out of memory on npm install of forked package HOT 1
- [FEATURE] Support peerDependency on Polaris 13 HOT 1
- ❓[Question] Is this package dead?
- [FEATURE]Disable decimals display if not necessary HOT 1
- [FEATURE] Update to Alpha components HOT 5
- [FEATURE] Add missing CustomerSegmentSelector component HOT 2
- ❓[Question] React 18 support? HOT 7
- [FEATURE] Update CombinationCard to support Product & Order discount combinations
- Discount is not active message is showing with DiscountStatus.Active
- [FEATURE] Support rendering inline errors in `MethodCard`
- 🐛[chore] add dependabot config
- Polaris uplift HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from discount-app-components.