File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ import { Footer } from '@/app/components/Footer'
12import { AppContextProvider } from '@/context'
2- import './globals.css'
33import type { Metadata } from 'next'
4- import { Footer } from './components/Footer'
4+ import Script from 'next/script'
5+ import './globals.css'
56
67export const metadata : Metadata = {
78 title : 'Client Home App' ,
@@ -15,6 +16,27 @@ export default async function RootLayout({
1516} ) {
1617 return (
1718 < html lang = 'en' >
19+ < head >
20+ { /* Make sure the error suppression script runs BEFORE sentry can init */ }
21+ < Script id = 'suppress-iframe-errors' strategy = 'beforeInteractive' >
22+ { `(function(){
23+ window.addEventListener('error', function(ev){
24+ var t = ev.target;
25+ if (t && t.tagName === 'IFRAME') {
26+ ev.stopImmediatePropagation();
27+ console.log('[iframe load error]', t.src);
28+ return;
29+ }
30+ if (ev instanceof ErrorEvent && ev.message === 'Script error.') {
31+ ev.stopImmediatePropagation();
32+ console.log('[iframe script error]', ev.filename);
33+ return;
34+ }
35+ }, true);
36+ })();` }
37+ </ Script >
38+ </ head >
39+
1840 < body >
1941 < AppContextProvider >
2042 { children }
Original file line number Diff line number Diff line change @@ -66,6 +66,10 @@ export const EmbedComponent = (props: any) => {
6666 src = { extractIframeSrc ( props . node . attrs . src ) }
6767 width = '100%'
6868 height = '100%'
69+ onError = { ( e ) => {
70+ e . stopPropagation ( )
71+ console . log ( '[iframe error]:' , e )
72+ } }
6973 />
7074 </ div >
7175 { ! pathname . includes ( 'client-preview' ) && ! appState ?. appState . readOnly && (
You can’t perform that action at this time.
0 commit comments