[{"data":1,"prerenderedAt":341,"buildId":342},["ShallowReactive",2],{"diagnostic-content-NUXT0101":3,"navigation_docs":240},{"id":4,"title":5,"body":6,"category":12,"code":228,"description":229,"docsUrl":13,"extension":230,"fix":231,"framework":232,"meta":233,"navigation":234,"pack":15,"path":235,"ruleId":16,"rulePath":17,"seo":236,"severity":18,"source":19,"sourceUrl":20,"stem":237,"why":238,"__hash__":239},"diagnostics\u002Fdiagnostics\u002FNUXT0101.md","NUXT0101: Pass external: true to navigateTo for external URLs",{"type":7,"value":8,"toc":216},"minimark",[9,21,26,42,46,57,61,66,69,108,111,152,156,159,184,188,200,204,212],[10,11],"rule-metadata",{"category":12,"docsUrl":13,"fix":14,"pack":15,"ruleId":16,"rulePath":17,"severity":18,"source":19,"sourceUrl":20},"routing","https:\u002F\u002Fnuxt.com\u002Fdocs\u002F4.x\u002Fapi\u002Futils\u002Fnavigate-to#external-url","suggestion","vite-doctor\u002Fnuxt","nuxt\u002Frouting\u002Fnavigate-to-external","\u002Fnuxt\u002Frules\u002Frouting\u002Fnavigate-to-external","error","src\u002Frule-packs\u002Fnuxt\u002Frules\u002Fnuxt\u002Fnavigate-to-external.ts","https:\u002F\u002Fgithub.com\u002Fwords-with-agents\u002Fvite-doctor\u002Fblob\u002Fmain\u002Fsrc\u002Frule-packs\u002Fnuxt\u002Frules\u002Fnuxt\u002Fnavigate-to-external.ts",[22,23,25],"h2",{"id":24},"why-it-happens","Why it happens",[27,28,29,33,34,37,38,41],"p",{},[30,31,32],"code",{},"navigateTo"," treats a target as external when ufo's ",[30,35,36],{},"hasProtocol(toPath, { acceptRelative: true })"," matches it, and throws instead of navigating unless the options set ",[30,39,40],{},"external: true",". The call fails at runtime with NUXT_E2001, \"Navigating to external URL is not allowed by default\", on the server and in the browser.",[22,43,45],{"id":44},"fix","Fix",[27,47,48,49,52,53,56],{},"Pass ",[30,50,51],{},"{ external: true }"," as the second argument. To open the URL in a new tab, pass ",[30,54,55],{},"{ open: { target: '_blank' } }"," instead.",[22,58,60],{"id":59},"example","Example",[62,63,65],"h3",{"id":64},"allow-the-external-navigation","Allow the external navigation",[27,67,68],{},"Before",[70,71,76],"pre",{"className":72,"code":73,"language":74,"meta":75,"style":75},"language-ts shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","await navigateTo('https:\u002F\u002Fexample.com\u002Flogin')\n","ts","",[30,77,78],{"__ignoreMap":75},[79,80,83,87,91,95,99,103,105],"span",{"class":81,"line":82},"line",1,[79,84,86],{"class":85},"s7zQu","await",[79,88,90],{"class":89},"s2Zo4"," navigateTo",[79,92,94],{"class":93},"sTEyZ","(",[79,96,98],{"class":97},"sMK4o","'",[79,100,102],{"class":101},"sfazB","https:\u002F\u002Fexample.com\u002Flogin",[79,104,98],{"class":97},[79,106,107],{"class":93},")\n",[27,109,110],{},"After",[70,112,114],{"className":72,"code":113,"language":74,"meta":75,"style":75},"await navigateTo('https:\u002F\u002Fexample.com\u002Flogin', { external: true })\n",[30,115,116],{"__ignoreMap":75},[79,117,118,120,122,124,126,128,130,133,136,140,143,147,150],{"class":81,"line":82},[79,119,86],{"class":85},[79,121,90],{"class":89},[79,123,94],{"class":93},[79,125,98],{"class":97},[79,127,102],{"class":101},[79,129,98],{"class":97},[79,131,132],{"class":97},",",[79,134,135],{"class":97}," {",[79,137,139],{"class":138},"swJcz"," external",[79,141,142],{"class":97},":",[79,144,146],{"class":145},"sfNiH"," true",[79,148,149],{"class":97}," }",[79,151,107],{"class":93},[22,153,155],{"id":154},"verify-the-fix","Verify the fix",[27,157,158],{},"Run only this rule after editing so the report stays focused on the diagnostic you are closing:",[70,160,164],{"className":161,"code":162,"language":163,"meta":75,"style":75},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","pnpm nuxt doctor --rules nuxt\u002Frouting\u002Fnavigate-to-external\n","bash",[30,165,166],{"__ignoreMap":75},[79,167,168,172,175,178,181],{"class":81,"line":82},[79,169,171],{"class":170},"sBMFI","pnpm",[79,173,174],{"class":101}," nuxt",[79,176,177],{"class":101}," doctor",[79,179,180],{"class":101}," --rules",[79,182,183],{"class":101}," nuxt\u002Frouting\u002Fnavigate-to-external\n",[22,185,187],{"id":186},"useful-links","Useful links",[189,190,191],"ul",{},[192,193,194],"li",{},[195,196,199],"a",{"href":13,"rel":197},[198],"nofollow","Upstream docs",[22,201,203],{"id":202},"related-rule","Related rule",[189,205,206],{},[192,207,208],{},[195,209,210],{"href":17},[30,211,16],{},[213,214,215],"style",{},"html pre.shiki code .s7zQu, html code.shiki .s7zQu{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}html pre.shiki code .sfNiH, html code.shiki .sfNiH{--shiki-light:#FF5370;--shiki-default:#FF9CAC;--shiki-dark:#FF9CAC}html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}",{"title":75,"searchDepth":217,"depth":217,"links":218},2,[219,220,221,225,226,227],{"id":24,"depth":217,"text":25},{"id":44,"depth":217,"text":45},{"id":59,"depth":217,"text":60,"children":222},[223],{"id":64,"depth":224,"text":65},3,{"id":154,"depth":217,"text":155},{"id":186,"depth":217,"text":187},{"id":202,"depth":217,"text":203},"NUXT0101","Finds `navigateTo()` calls whose target is a string literal with a protocol, such as `https:\u002F\u002F` or `mailto:`, or a protocol-relative `\u002F\u002F` URL, and no `{ external: true }`. Template literals and `+` concatenations count when their leading literal text already makes the URL external. Calls with `open`, spread options, or a computed `external` value are not reported, nor are `navigateTo` bindings that do not come from Nuxt.","md","Pass `{ external: true }` as the second argument. To open the URL in a new tab, pass `{ open: { target: '_blank' } }` instead.","nuxt",{},true,"\u002Fdiagnostics\u002Fnuxt0101",{"title":5,"description":229},"diagnostics\u002FNUXT0101","`navigateTo` treats a target as external when ufo's `hasProtocol(toPath, { acceptRelative: true })` matches it, and throws instead of navigating unless the options set `external: true`. The call fails at runtime with NUXT_E2001, \"Navigating to external URL is not allowed by default\", on the server and in the browser.","LSld2ndELPJ57PfKa2Lau7FLj_8AetrgMuYXMC9_eP8",[241,269,273,277,281,285,289,301,305,329,333,337],{"title":242,"path":243,"stem":244,"children":245,"icon":268},"CLI","\u002Fcli","1.cli\u002F1.index",[246,248,252,256,260,264],{"title":247,"path":243,"stem":244},"Run Doctor",{"title":249,"path":250,"stem":251},"Reports","\u002Fcli\u002Freports","1.cli\u002F2.reports",{"title":253,"path":254,"stem":255},"Configuration","\u002Fcli\u002Fconfiguration","1.cli\u002F3.configuration",{"title":257,"path":258,"stem":259},"CI and changed files","\u002Fcli\u002Fci","1.cli\u002F4.ci",{"title":261,"path":262,"stem":263},"Workspaces","\u002Fcli\u002Fworkspaces","1.cli\u002F5.workspaces",{"title":265,"path":266,"stem":267},"Cache and speed","\u002Fcli\u002Fcache","1.cli\u002F6.cache","i-lucide-terminal",{"title":270,"path":271,"stem":272},"Nuxt","\u002Fnuxt","2.nuxt",{"title":274,"path":275,"stem":276},"Vue","\u002Fvue","3.vue",{"title":278,"path":279,"stem":280},"Vite","\u002Fvite","4.vite",{"title":282,"path":283,"stem":284},"Nitro","\u002Fnitro","5.nitro",{"title":286,"path":287,"stem":288},"TypeScript","\u002Ftypescript","6.typescript",{"title":290,"path":291,"stem":292,"children":293,"icon":300},"Design system","\u002Fdesign-system","7.design-system\u002F1.index",[294,296],{"title":295,"path":291,"stem":292},"Overview",{"title":297,"path":298,"stem":299},"Classes and styles","\u002Fdesign-system\u002Fclasses","7.design-system\u002F2.classes","i-lucide-swatch-book",{"title":302,"path":303,"stem":304},"Package","\u002Fpackage","8.package",{"title":306,"path":307,"stem":308,"children":309,"icon":328},"Extending Doctor","\u002Fextending","9.extending\u002F1.index",[310,312,316,320,324],{"title":311,"path":307,"stem":308},"Write an extension",{"title":313,"path":314,"stem":315},"Visitors","\u002Fextending\u002Fvisitors","9.extending\u002F2.visitors",{"title":317,"path":318,"stem":319},"Ship with a library","\u002Fextending\u002Fshipping","9.extending\u002F3.shipping",{"title":321,"path":322,"stem":323},"Test a Rule","\u002Fextending\u002Ftesting","9.extending\u002F4.testing",{"title":325,"path":326,"stem":327},"Rule inputs","\u002Fextending\u002Frule-inputs","9.extending\u002F5.rule-inputs","i-lucide-puzzle",{"title":330,"path":331,"stem":332},"H3","\u002Fh3","9.h3",{"title":334,"path":335,"stem":336},"MCP","\u002Fmodel-context-protocol","9.model-context-protocol",{"title":338,"path":339,"stem":340},"Pinia","\u002Fpinia","9.pinia",1796507787454,"e745db9b-2064-477e-b678-8c0a05edc39c"]