App reviews, troubleshooting, and recommendations
We are trying to embed our app, built in React Vite and we keep getting the same errors regarding the iframe:
Blocked script execution in '<URL>' because the document's frame is sandboxed and the 'allow-scripts' permission is not set.
Refused to frame 'https://github.com/' because an ancestor violates the following Content Security Policy directive: "frame-ancestors 'none'".
I'm not sure if GitHub allows the CSP for the framesource but not sure how to get around it so we can keep building out the app. Been stuck here for 2 days. Any thoughts?
I'm having the same problem, can't load my app anymore
I think there is a piece of middleware missing that helps install the Content Security Platform and this is using NextJS framework. Seems to solve the issue.
/** Middleware Content Security Policy headers to match requests. */
import { NextResponse } from "next/server";
export const config = {
matcher: [
/*
* Exceptions:
* /api/auth, /api/webhooks, /api/proxy_route, /api/gdpr, /_next,
* /_proxy, /_auth, /_static, /_vercel, /public (/favicon.ico, etc)
*/
"/((?!api/auth|api/webhooks|api/proxy_route|api/gdpr|_next|_proxy|_auth|_static|_vercel|[\\w-]+\\.\\w+).*)",
],
};
/**
* @Anonymous {NextRequest} request - The incoming request object.
* @returns {NextResponse} The response object with modified headers.
*/
export function middleware(request) {
const {
nextUrl: { search },
} = request;
const urlSearchParams = new URLSearchParams(search);
const params = Object.fromEntries(urlSearchParams.entries());
const shop = params.shop || "*.myshopify.com";
const res = NextResponse.next();
res.headers.set(
"Content-Security-Policy",
`frame-ancestors https://${shop} https://admin.shopify.com;`
);
return res;
}
@ced1968 I have the same issue. with my production app it was working fine. but from the last week I can see the many shop req. goes to 403.
I have also validated the CSP was correct.
any suggestion?
Blocked script execution in '<URL>' because the document's frame is sandboxed and the 'allow-scripts' permission is not set.
I also encountered a similar issue.
@ced1968 @stoneknocker Any suggestions DM me let's connect for the same issue we can resolve.
Encountered same issue on production, CSP is set correctly, did anyone find a way around this ?
I wrestled with this one for weeks, until I found that adding a <Page> Polaris component wrapper to my Remix component (which probably should have always been there) made this error go away. Wasn't aware that was absolutely compulsory, but it solved this one immediately.
I'll give that a try and report back.
I've been seeing this message throughout the year. The app would load in fits and starts. Right now it's not loading. Found this looking to see if others are having the issue. And it looks like they are. I'm about to comb through the authentication system...
In Canada, payment processors, like those that provide payment processing services t...
By Jacqui Mar 14, 2025Unlock the potential of marketing on your business growth with Shopify Academy's late...
By Shopify Mar 12, 2025Learn how to increase conversion rates in every stage of the customer journey by enroll...
By Shopify Mar 5, 2025