{"record":{"id":"2d4c5960fbecd256","repo":"vuejs/devtools-v6","slug":"vue-devtools-no-hook-in-parent-window","errorCode":null,"errorMessage":"[Vue Devtools] No hook in parent window","messagePattern":"\\[Vue Devtools\\] No hook in parent window","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/app-backend-core/src/hook.ts","lineNumber":78,"sourceCode":"\n  if (Object.prototype.hasOwnProperty.call(target, '__VUE_DEVTOOLS_GLOBAL_HOOK__')) {\n    if (target.__VUE_DEVTOOLS_GLOBAL_HOOK__.devtoolsVersion !== devtoolsVersion) {\n      console.error(`Another version of Vue Devtools seems to be installed. Please enable only one version at a time.`)\n    }\n    return\n  }\n\n  let hook\n\n  if (isIframe) {\n    const sendToParent = (cb) => {\n      try {\n        const hook = (window.parent as any).__VUE_DEVTOOLS_GLOBAL_HOOK__\n        if (hook) {\n          return cb(hook)\n        }\n        else {\n          console.warn('[Vue Devtools] No hook in parent window')\n        }\n      }\n      catch (e) {\n        console.warn('[Vue Devtools] Failed to send message to parent window', e)\n      }\n    }\n\n    hook = {\n      devtoolsVersion,\n      // eslint-disable-next-line accessor-pairs\n      set Vue(value) {\n        sendToParent((hook) => {\n          hook.Vue = value\n        })\n      },\n\n      // eslint-disable-next-line accessor-pairs\n      set enabled(value) {","sourceCodeStart":60,"sourceCodeEnd":96,"githubUrl":"https://github.com/vuejs/devtools-v6/blob/dd2ab5d4275187cbd81952a2a3d53c335643c1f4/packages/app-backend-core/src/hook.ts#L60-L96","documentation":"sendToParent tries to communicate with `window.parent.__VUE_DEVTOOLS_GLOBAL_HOOK__` when the backend runs inside an iframe. When the parent exists but has no devtools hook installed, it logs this warning instead of throwing, so the message is silently dropped. It means devtools UI will not receive events from the iframe app.","triggerScenarios":"The app backend runs in an iframe whose parent window does not have `__VUE_DEVTOOLS_GLOBAL_HOOK__` installed — i.e. no devtools extension/backend script in the parent, or the parent is a different origin/setup without the hook. Any sendToParent call (on/off/emit/Vue wrapper) then warns.","commonSituations":"Embedding a Vue app in an iframe inside a page that doesn't run devtools backend; cross-origin iframes where the hook can't be accessed; loading the app standalone but code still assumes an iframe host; devtools extension disabled in the parent context.","solutions":["Ensure the parent window loads the Vue devtools backend/extension so `__VUE_DEVTOOLS_GLOBAL_HOOK__` exists before the iframe app initializes.","If the app is not meant to run in an iframe, avoid the iframe embedding or detect `window.parent === window` and skip parent communication.","For custom hosting pages, create the hook in the parent first (e.g. by importing the hook package) before loading the iframe app.","Treat the warning as benign if devtools features in the parent are not needed; the app itself is unaffected."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"const hasParentHook = window.parent !== window && !!(window.parent).__VUE_DEVTOOLS_GLOBAL_HOOK__","typeGuard":"function parentHasHook() {\n  try { return window.parent !== window && typeof (window.parent as any).__VUE_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' }\n  catch { return false }\n}","tryCatchPattern":null,"preventionTips":["Install the devtools hook in the parent page before embedding iframe apps","Only enable parent communication when the app actually runs in an iframe","Treat the warning as benign when devtools integration is not required"],"tags":["iframe","hook","devtools","communication"],"backgroundTag":"devtools-hook-missing","analyzedSha":"dd2ab5d4275187cbd81952a2a3d53c335643c1f4","analyzedAt":"2026-08-31T12:41:59.822Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}