Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Demo Store Template: ShopPayButton seems to be inert #487

Closed
mw10013 opened this issue Feb 10, 2023 · 3 comments
Closed

Demo Store Template: ShopPayButton seems to be inert #487

mw10013 opened this issue Feb 10, 2023 · 3 comments
Assignees

Comments

@mw10013
Copy link

mw10013 commented Feb 10, 2023

What is the location of your example repository?

pnpm create @shopify/hydrogen@latest with Demo Store template

What version of Hydrogen are you using?

2023.1.2

What version of Remix are you using?

1.12.0

Steps to Reproduce

  • pnpm create @shopify/hydrogen@latest with Demo Store template
  • navigate to a product page in browser (eg /products/snowboard)
  • click on Shop Pay button

Expected Behavior

Clicking on Shop Pay button navigates to Shopify's pay page.

Actual Behavior

Clicking on Shop Pay button seems to do nothing and stays on the product page.

Dev Tools console contains message: [Shop Pay] Store URL (test) is not valid TypeError: Failed to construct 'URL': Invalid URL

ShopPayButton.d.ts in @shopify/hydrogen-react has comment indicating that is needed.

/**
 * The `ShopPayButton` component renders a button that redirects to the Shop Pay checkout.
 * It renders a [`<shop-pay-button>`](https://shopify.dev/custom-storefronts/tools/web-components) custom element, for which it will lazy-load the source code automatically.
 * It relies on the `<ShopProvider>` context provider.
 */
export declare function ShopPayButton({ variantIds, className, variantIdsAndQuantities, width, }: ShopPayButtonProps): JSX.Element;

looks like a typo and probably should be . Either way, it is not in the component tree. While @shopify/hydrogen seems to export ShopPayButton, but not ShopifyProvider from @shopify/hydrogen-react.

@wizardlyhel
Copy link
Contributor

Mmm yes - that is a typo. That should be ShopifyProvider.

@frehner Maybe a better path is to not rely on useShop and allow storeDomain to be passed in as props?

@frehner
Copy link
Contributor

frehner commented Feb 13, 2023

@wizardlyhel tracking that here #629 🙂

@frehner
Copy link
Contributor

frehner commented Mar 23, 2023

This was fixed in #645

@frehner frehner closed this as completed Mar 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants