Shopify / shopify-marketplaces-admin-app

MIT License
38 stars 45 forks source link

Following Getting Started Instructions does not work and fails with <Provider> error #54

Closed Bovojon closed 1 year ago

Bovojon commented 1 year ago

After following the Getting Starting instructions to the dot and running shopify2 app serve, it says that the app is running on http://localhost:8081 but when navigating to the url, the page doesn't load and gives the following error:

The above error occurred in the <Provider> component:
    in Provider (created by ExtendedAppProvider)
    in ExtendedAppProvider (created by AppProvider)
    in AppProvider (created by Router)
    in RenderedRoute (created by Routes)
    in Routes (created by Router)
    in Router (created by BrowserRouter)
    in BrowserRouter (created by Router)
    in Router
    in AppContainer

React will try to recreate this component tree from scratch using the error boundary you provided, AppContainer.

Can someone from the team please try running the instructions to check if the app still works?

Would highly appreciate figuring out what has broken. Thank you so much.

Env:

kott commented 1 year ago

Hey @Bovojon 👋 If you just navigate to http://localhost:8081 you will see the error you are getting, along with the error message that reads: APP::ERROR::INVALID_CONFIG: host must be provided. This is because you are trying to navigate to the app directly, but app bridge requires the app to be loaded in the context of a shop. In the output of shopify app serve you should see instructions on how to install the shop. There should be a line that says something similar to:

 To install and start using your app, open this URL in your browser:
https://<some-id>.ngrok-free.app/login?shop=<your-shop>.myshopify.com

If this isn't the case, ensure you have the following in your .env file:

SHOPIFY_API_KEY=<your-key>
SHOPIFY_API_SECRET=<your-secret>
SHOP=<your-shop>
SCOPES=<scopes>
HOST=<>

You should be able to get these values from your partner account when you create an app. The instructions should be outlined here.

Bovojon commented 1 year ago

Thank you very much, @kott. I missed that part somehow 😅

Since Shopify CLI 2.x will sunsetting soon, just wondering if the team has any plans for a new CLI 3 Merchant Facing App template?

Bovojon commented 1 year ago

Thank you!