Evita Urbanoviča
Evita Urbanoviča

Reputation: 110

Expected a valid shop query parameter

I'm trying to create new Shopify app using shopify-app-cli, I set up all redirect links and .env file, but when I run Shopify serve and when it says Ready on http://localhost:8081, I go to localhost page and it shows this error: Expected a valid shop query parameter. What does it mean?

I checked my .env file for maybe typos, but everything is copied fine.

Upvotes: 4

Views: 6229

Answers (4)

Adam A Allalou
Adam A Allalou

Reputation: 2019

This can be a problem with ngrok URL or a third-party service in your Shopify app blocking the connection.

1-

You'll need to set up your app in the partners dashboard with the ngrok URL you get from Shopify server, ex:

https://ea6214072ff3.ngrok.io

https://ea62d4072ff3.ngrok.io/auth/callback

Check this github issue or this blog-post for more info.

2-

In case you're using a third-party's server like MangoDB in your app, you need to change your DNS server address (some ISPs cram as many DNS’s as possible). I will be using Google's DNS 8.8.8.8 in this example:

Linux:

  1. If you are connected to a WiFi network click on the “Wi-FI” tab. Otherwise, if you have a wired connection click on the “Network” tab.

  2. Select the connection for which you want to set the DNS nameservers and click on the cog icon to open the Network Manager.

  3. Select the IPv4 Settings tab.

  4. Disable the “Automatic” toggle switch and enter the DNS resolvers IP addresses 8.8.8.8

  5. Clear (Flush) the DNS cash (required for Ubuntu 18.04^) follow this article

Windows:

  1. Control Panel and select Network and sharing center.

  2. Click on Change adapter settings.

  3. right-click on Local Area Connection and then select Properties.

  4. select the option Internet Protocol Version 4 (TCP/IPv4) and then click on properties.

  5. Choose the radio button Use the following DNS server addresses and enter the 8.8.8.8 value in Preferred DNS server:

  6. Clear (Flush) the DNS cash follow this article

Upvotes: 0

Neil
Neil

Reputation: 8584

Had the same error; was able to fix it by going to url mentioned after shopify create was executed:

  • Run shopify serve to start a local server

    Then, visit https://partners.shopify.com/<ACCOUNT-ID>/apps/<APP-ID>/test to install on your Dev Store

see: https://github.com/Shopify/shopify-app-cli/issues/201#issuecomment-620286966

Upvotes: 0

alexey
alexey

Reputation: 1411

in my case the problem was in Safari, it's worth checking in Chrome

Upvotes: 0

someoneuseless
someoneuseless

Reputation: 295

That mean you have miss yourshopname.myshopify.com . This needed when you authenticated your app.

https://yourshopname.myshopify.com/admin/oauth/authorize?client_id='your_api_key'&scope='your_scopes_require'&redirect_uri='your_redirect_url'

For more information read here

Upvotes: 5

Related Questions