Failed to execute ‘postMessage’ on ‘DOMWindow’: The target origin provided (‘’) does not match the recipient window’s origin (‘’). in the console of my shopify app. which shows blank page on all the pages of my shopify app.
Can anyone give solution to my error, I have been stuck in this for two days.
Here is my code,
import { json } from "@remix-run/node";
import { Link, Outlet, useLoaderData, useRouteError } from "@remix-run/react";
import polarisStyles from "@shopify/polaris/build/esm/styles.css";
import { boundary } from "@shopify/shopify-app-remix/server";
import { AppProvider } from "@shopify/shopify-app-remix/react";
import { authenticate } from "../shopify.server";
import { Page, Layout,Button, Form, FormLayout, TextField, Card,RadioButton } from "@shopify/polaris";
import {useState, useCallback} from 'react';
export const links = () => [{ rel: "stylesheet", href: polarisStyles }];
export const loader = async ({ request }) => {
await authenticate.admin(request);
return json({ apiKey: process.env.SHOPIFY_API_KEY || "" });
};
export default function Apptopay() {
const { apiKey } = useLoaderData();
return (
<Page
backAction={{content: 'Settings', url: '#'}}
title="Apptopay Configuration Settings"
primaryAction={<Button variant="primary">Save</Button>}
>
<Card>
<Form >
<TextField label="Authentication Key" type="text"
align="right" />
<TextField label="Retailer ID" type="text" />
<TextField label="Retailer GUID" type="text" />
<TextField label="Product ID" type="text" />
<TextField label="Product GUID" type="text" />
</Form>
</Card>
</Page>
);
}
// Shopify needs Remix to catch some thrown responses, so that their headers are included in the response.
export function ErrorBoundary() {
return boundary.error(useRouteError());
}
export const headers = (headersArgs) => {
return boundary.headers(headersArgs);
};
