Hello everyone,
I am developing a custom shopify app. It works when using local hosting but when hosting on Heroku I am getting a server 500 error. I get a little more info when I change 3 config variables (APP_DEBUG, LOG_LEVEL, and LOG_CHANNEL).
When local hosting it appears the shop is set to my test store name quickstart and #'s. The Shopify docs do not state that the shop name should be added as a config variable. Is there something I am missing programmatically?
Here is the full error: Shopify\Utils::sanitizeShopDomain(): Argument #1 ($shop) must be of type string, null given, called in /app/app/Lib/AuthRedirection.php on line 20.
The code in question is:
NOTE: I added the prints and the shop is null.
public static function redirect(Request $request, bool $isOnline = false): RedirectResponse
{
LogHelper::print("*****************************");
LogHelper::print($request->query("shop"));
$shop = Utils::sanitizeShopDomain($request->query("shop"));
if (Context::$IS_EMBEDDED_APP && $request->query("embedded", false) === "1") {
$redirectUrl = self::clientSideRedirectUrl($shop, $request->query());
} else {
$redirectUrl = self::serverSideRedirectUrl($shop, $isOnline);
}
return redirect($redirectUrl);
}