-
Notifications
You must be signed in to change notification settings - Fork 5
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
Error opening application in production #56
Comments
Hi, can you share some of the logs from PM2? |
That bit is expected, on initial load it performs a few oAuth connections it seems to fail after a while, someone recently had that issue but that was on dev. can you confirm the dependencies in the root package.json? I might be able to recreate it |
Alright let's do the following,
the redirect URLs must be set properly let me know if the issue gets resolved |
Hi, I did everything as you mentioned and nothing works, I still have the same error |
Hi, Can you try the following : //index.js
const addSessionShopToReqParams = (req, res, next) => {
const shop = res.locals?.shopify?.session?.shop;
if (shop && !req.query.shop) {
req.query.shop = shop;
}
console.log("SHOP:", shop, req.query.shop);
return next();
};
app.use("/api/*", shopify.validateAuthenticatedSession());
// Middleware should come after
app.use("/*", addSessionShopToReqParams); |
Thanks for answering, mmm no, I had already tried it before and it still shows me the same error, but nothing work's, here we have a video with the error: https://screenshot.click/05-57-31754-74340.webm |
Interesting, It seems your app is working the issue might be with the root Can you show me what that looks like? Be sure to hide sensitive information such as the |
Also out of curiosity, how are you running the app? |
in my own server, is a windows server |
RE: the issue might be with the scopes in the root shopify.app.toml Can you show me what that looks like? Be sure to hide sensitive information such as the client_id |
Alright, so a few things you need to setup before running the app in production Step 1
Step 2In the shopify.app.toml: [access_scopes]
# Learn more at https://shopify.dev/docs/apps/tools/cli/configuration#access_scopes
scopes = "read_customers,read_orders" # Add the access scopes you need !very important
use_legacy_install_flow = true #You may OMIT THIS Step 3 Very Very Important
[auth]
redirect_urls = [
"https://minisylar.com/auth/callback",
"https://minisylar.com/auth/shopify/callback",
"https://minisylar.com/api/auth/callback"
] Step 4 Push the changes
Step 5 (Since you're on a VPS) - I've only used linux so windows setup may vary
As always let me know if there are any issues, in order to not conflict the toml files |
Hi
I used the template with Vue to create my app, but I have the following problem when deploying to production:
1.- The app couldn't be loaded:
2.- When I try to open the application I get the following error:
I am deploying my application via PM2 on my own server, so I don't know if this is a factor in the error. I look forward to your comments.
The text was updated successfully, but these errors were encountered: