responsively-org/responsively-app · info
iframe error:
Error message
iframe error:
What it means
This is not a throw but a console.warn emitted in didFailLoadHandler when a webContents 'did-fail-load' event reports isMainFrame === false. Sub-frame (iframe) load failures such as CSP-blocked resources or X-Frame-Only pages are deliberately demoted to console output so the renderer only shows a full error overlay for main-frame failures. Seeing 'iframe error:' in the console means an embedded frame failed to load, not the page itself.
Source
Thrown at desktop-app/src/renderer/components/Previewer/Device/index.tsx:402
handlerRemovers.push(() => {
webview.removeEventListener('did-stop-loading', didStopLoadingHandler);
});
const didFailLoadHandler = ({
errorCode,
errorDescription,
isMainFrame,
}: Electron.DidFailLoadEvent) => {
if (errorCode === -3) {
// Aborted error, can be ignored
return;
}
// Only show error overlay for main frame errors
// Iframe errors (like CSP violations) should only go to console
if (!isMainFrame) {
// eslint-disable-next-line no-console
console.warn('iframe error:', errorCode, errorDescription);
return;
}
setError({
code: errorCode,
description: errorDescription,
});
};
webview.addEventListener('did-fail-load', didFailLoadHandler);
handlerRemovers.push(() => {
webview.removeEventListener('did-fail-load', didFailLoadHandler);
});
if (!isPrimary) {
setTimeout(() => {
webview.addEventListener('dom-ready', () => {
window.electron.ipcRenderer.invoke<
DisableDefaultWindowOpenHandlerArgs,View on GitHub (pinned to e5623c5a70)
Solutions
- Verify the main page still renders; if it does, this warning is expected and ignorable
- If the iframe content is required, fix the source page's CSP/X-Frame-Options headers to allow embedding
- Whitelist known-noisy sub-frame error codes in the warn filter if console spam is an issue
- If the overlay incorrectly appears, check that isMainFrame is being read from the event args and not defaulting
Defensive patterns
Strategy: type-guard
Validate before calling
webContents.on('did-fail-load', (event, errorCode, errorDescription, validatedURL, isMainFrame) => {
if (typeof isMainFrame !== 'boolean') return;
if (!isMainFrame) {
console.warn('iframe error:', errorCode, errorDescription);
return;
}
setError({ code: errorCode, description: errorDescription });
}); Type guard
function isMainFrameLoadFailure(args: { isMainFrame?: boolean }): args is { isMainFrame: true } {
return args.isMainFrame === true;
} Prevention
- Always branch on isMainFrame before showing error overlays
- Filter out benign sub-frame codes (aborted, blocked-by-CSP) from logging if noisy
- Test previewing pages with CSP-protected iframes and ad iframes
- Remember this warn is informational; the main page may be fine
When it happens
Trigger: An iframe inside the loaded page fails with codes like ERR_BLOCKED_BY_RESPONSE (CSP frame-ancestors), ERR_CERT errors on embedded resources, or aborted subresource loads; the handler receives (event, errorCode, errorDescription, validatedURL, isMainFrame=false).
Common situations: Embedding sites that send CSP frame-ancestors or X-Frame-Options DENY, mixed-content blocked iframes, ad/analytics iframes failing in offline mode, previewing pages with third-party embeds.
Related errors
AI-assisted analysis of responsively-org/responsively-app@e5623c5a70 (2026-08-31).
Data as JSON: /api/errors/e2bf956dd5c5f8f6.
Report an issue: GitHub.