App is not running in local development Nodejs and React

Ezat
New Member
2 0 0

Hello fellows, I am following the Node app, with the shopify cli I run the command shopify node open, this isn't running the app in local environment,

instead it outputs:

https://bedc36907293.ngrok.io/auth?shop=myshopurl

 

when running the shopify node serve command this will run the app with ngrok in shopify admin panel, but it says the app is ready:

event - compiled successfully
> Ready on http://localhost:8081

when visiting the localhost:8081 it cannot complete oAuth, and url is: until the page says,  This site can’t be reached

http://localhost:8081/auth?shop=undefined

 

anyone else facing the same issue? or is it not possible to run the app locally? 

0 Likes
jtenax
New Member
1 0 0

I've managed to resolve this 'undefined' issue by copying the .env file to process.env, as the server.js was trying to get the configuration from the absent process.env file. Now, I'm properly redirecting to my development store's URL instead of undefined. However, I'm still getting another error in my console which I'm trying to solve now:

 

 

InternalServerError: Cannot complete OAuth process. Could not find an OAuth cookie for shop url: qarea-test-store.myshopify.com
┃       at Object.throw (/var/www/test_node_app-2/node_modules/koa/lib/context.js:97:11)
┃       at /var/www/test_node_app-2/node_modules/@shopify/koa-shopify-auth/dist/src/auth/index.js:100:42
┃       at step (/var/www/test_node_app-2/node_modules/tslib/tslib.js:133:27)
┃       at Object.throw (/var/www/test_node_app-2/node_modules/tslib/tslib.js:114:57)
┃       at rejected (/var/www/test_node_app-2/node_modules/tslib/tslib.js:105:69)
┃       at runMicrotasks (<anonymous>)
┃       at processTicksAndRejections (internal/process/task_queues.js:95:5)

 

 

 

UPDATE: the above error can be fixed using this patch which I found here in this shopify node app issue request.

 

0 Likes