File tree Expand file tree Collapse file tree
packages/devtools/src/runtime/plugins/view Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -128,8 +128,14 @@ export async function setupDevToolsClient({
128128 iframe . id = 'nuxt-devtools-iframe'
129129 iframe . src = initialUrl
130130 iframe . onload = async ( ) => {
131- await waitForClientInjection ( )
132- client . syncClient ( )
131+ try {
132+ await waitForClientInjection ( )
133+ client . syncClient ( )
134+ }
135+ catch ( e ) {
136+ console . error ( 'Nuxt DevTools client injection failed' )
137+ console . error ( e )
138+ }
133139 }
134140 }
135141 catch ( e ) {
@@ -141,12 +147,13 @@ export async function setupDevToolsClient({
141147 }
142148
143149 function waitForClientInjection ( retry = 10 , timeout = 200 ) {
150+ let lastError : any
144151 const test = ( ) => {
145152 try {
146153 return ! ! iframe ?. contentWindow ?. __NUXT_DEVTOOLS_VIEW__
147154 }
148155 catch ( e ) {
149-
156+ lastError = e
150157 }
151158 return false
152159 }
@@ -162,8 +169,7 @@ export async function setupDevToolsClient({
162169 }
163170 else if ( retry -- <= 0 ) {
164171 clearInterval ( interval )
165- // eslint-disable-next-line prefer-promise-reject-errors
166- reject ( 'Nuxt DevTools client injection failed' )
172+ reject ( lastError )
167173 }
168174 } , timeout )
169175 } )
You can’t perform that action at this time.
0 commit comments