shopify app not working on localhost (Osiset\ShopifyApp\Exceptions\MissingShopDomainException) #686
Replies: 4 comments 10 replies
-
This is because Laravel expects a shop parameter. Append |
Beta Was this translation helpful? Give feedback.
-
I know I have to setup some kind of certificate for that. But dont know how to setup “Laradock” or “Docker” in the pc.
|
Beta Was this translation helpful? Give feedback.
-
I have the same problem but in the ajax request, I can view the homepage but if i send an ajax request to backend laravel throw this exception. I use axios ajax. I notice in the dev tools the ajax return a html trying redirect to shopify auth, but it not work because its an ajax. its the console.log of data returned <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<base target="_top">
<title>Redirecting...</title>
<script type="text/javascript">
document.addEventListener('DOMContentLoaded', function () {
var redirectUrl = URLHIDDEN;
if (window.top == window.self) {
// If the current window is the 'parent', change the URL by setting location.href
window.top.location.href = redirectUrl;
} else {
// If the current window is the 'child', change the parent's URL with postMessage
normalizedLink = document.createElement('a');
normalizedLink.href = redirectUrl;
data = JSON.stringify({
message: 'Shopify.API.remoteRedirect',
data: { location: redirectUrl },
});
window.parent.postMessage(data, "https://krakencfe.myshopify.com");
}
});
</script>
</head>
<body>
</body>
</html> |
Beta Was this translation helpful? Give feedback.
-
Shouldn't need to add the shop. If you're logged in and cookies are fine. I
think you'll need to send cookies with the ajax call possibly
…On Thu., Feb. 25, 2021, 12:06 maganius, ***@***.***> wrote:
Have you authenticated your session with Shopify before sending the Ajax
request?
You can check by hitting a route that has the auth.shopify middleware and
adding a ?shop=mystore.myshopify.com parameter at the end of the url
[image: image]
<https://user-images.githubusercontent.com/8250243/109176820-f3c35880-7765-11eb-9cd2-ae60c82dcfd3.png>
I think its authenticated because If I enter to homepage my shop name is
displayed correctly, but when I start an ajax with axios it try redirect to
oauth, check image.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#686 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AASO4OUGWGDYG3O7AFEWIHTTAZVBHANCNFSM4XK6Z65Q>
.
|
Beta Was this translation helpful? Give feedback.
-
Hey, @osiset
I have installed the fresh laravel 8 and laravel-shopify package for developing a Shopify app. I did the all setting according to the GitHub wiki. in Shopify, my app is working fine, but on localhost, I get the error "Osiset\ShopifyApp\Exceptions\MissingShopDomainException". can I run the app on localhost as well?
route.php file:-
Route::get('/','ProductsController@view')->middleware(['auth.shopify'])->name('home');
products.blade.php file:-
i have copy the defult.blade.php file in
views\vendor\shopify-app\layouts
.I am on windows and working on xampp. please help
Beta Was this translation helpful? Give feedback.
All reactions