Errors after creating my app using shopify create command line with NodeJS

Solved

Errors after creating my app using shopify create command line with NodeJS

procarrera
Shopify Partner
13 2 4

Hi folks,

I am new here. I was trying to build my first App, following the tutorial with the Shopify CLI, but i am getting errors when accessing my localhost or ngrok link as shown below.

My Steps:

  1. I have created using the command line: shopify create
  2. Choose NodeJS
  3. Everything was perfectly installed with no errors
  4. I have installed the App in my store with no problems
  5. .env file was updated automatically my ngrok link, also the app configs in the partner dashboard

I am going to develop a custom app to my customer and appreciate your help.

Thanks!


ERROR AT: http://localhost:8081/auth

Expected a valid shop query parameter

Screenshot_2021-01-12_08-23-14.png


ERROR AR https://90d3121fb450.ngrok.io/

 

1 of 1 unhandled error
Unhandled Runtime Error
AppBridgeError: APP::ERROR::INVALID_CONFIG: shopOrigin must be provided

 

Screenshot_2021-01-12_08-22-51.png


App seems to be installed correctly:

Screenshot_2021-01-12_08-34-09.png


App is running ok in the embed admin panel:

Screenshot_2021-01-12_08-23-33.png

Accepted Solution (1)
procarrera
Shopify Partner
13 2 4

This is an accepted solution.

Hi !

I have solved the problem by creating my app following step-by-step instructions not through Shopify CLI and it works.

 

However, I still cannot access in localhost, only by ngrok link. I guess it is because of HTTP instead of HTTPS.

 

Thank you for your time!

View solution in original post

Replies 4 (4)

Jayvin
Shopify Partner
284 42 89

Hi,

It seems like you are missing the ?shop={SHOP_NAME} during oauth.

banned
procarrera
Shopify Partner
13 2 4

Hi Jayvin!!

Thanks for your reply, as i said, i am quite new here.

So basically i haven't changed anything in the code and i expected it to run smooth on both embedded and localhost app.

 

I tried to add the shop query to the string but not succeed (http://localhost:8081/auth?shop=procarrera.myshopfy.com)

returned with this error:

 

 

Oauth error invalid_request: The redirect_uri is not whitelisted

 

 

When i try to access the ngrok link with auth, it succeed but redirects me to the embed app.

and when i try to access the ngrok link without auth (https://90d3121fb450.ngrok.io/) i got the error about the shopOrigin as mentioned about, even if it is present in the cookies:

Screenshot_2021-01-13_17-08-15.png

Jayvin
Shopify Partner
284 42 89

Hi!,

Since you are new here, please go through the documentation on how to create an app, adding redirection urls and oauth process.

These couple of resources will help you.

https://shopify.dev/tutorials/authenticate-a-custom-app-with-oauth
https://shopify.dev/tutorials/authenticate-with-oauth
https://shopify.dev/tutorials/authenticate-a-public-app-with-oauth

banned
procarrera
Shopify Partner
13 2 4

This is an accepted solution.

Hi !

I have solved the problem by creating my app following step-by-step instructions not through Shopify CLI and it works.

 

However, I still cannot access in localhost, only by ngrok link. I guess it is because of HTTP instead of HTTPS.

 

Thank you for your time!