[{"data":1,"prerenderedAt":381},["ShallowReactive",2],{"navigation_docs":3,"rule-content-\u002Fnuxt\u002Frules\u002Fhydration\u002Frequire-clientonly-fallback":48},[4,8,12,16,20,24,28,32,36,40,44],{"title":5,"path":6,"stem":7},"CLI","\u002Fcli","1.cli",{"title":9,"path":10,"stem":11},"Nuxt","\u002Fnuxt","2.nuxt",{"title":13,"path":14,"stem":15},"Vue","\u002Fvue","3.vue",{"title":17,"path":18,"stem":19},"Vite","\u002Fvite","4.vite",{"title":21,"path":22,"stem":23},"Nitro","\u002Fnitro","5.nitro",{"title":25,"path":26,"stem":27},"TypeScript","\u002Ftypescript","6.typescript",{"title":29,"path":30,"stem":31},"shadcn","\u002Fshadcn","7.shadcn",{"title":33,"path":34,"stem":35},"Package","\u002Fpackage","8.package",{"title":37,"path":38,"stem":39},"Extending Doctor","\u002Fextending","9.extending",{"title":41,"path":42,"stem":43},"MCP","\u002Fmcp","9.mcp",{"title":45,"path":46,"stem":47},"Pinia","\u002Fpinia","9.pinia",{"id":49,"title":50,"body":51,"category":57,"description":368,"diagnosticCodes":369,"docsUrl":59,"extension":370,"fix":60,"framework":371,"meta":372,"navigation":373,"pack":61,"path":375,"recommendedReplacement":376,"ruleId":62,"seo":377,"severity":63,"source":64,"sourceUrl":65,"stem":378,"why":379,"__hash__":380},"rules\u002Fnuxt\u002Frules\u002Fhydration\u002Frequire-clientonly-fallback.md","Give ClientOnly a server fallback",{"type":52,"value":53,"toc":359},"minimark",[54,66,71,109,113,125,129,138,142,154,158,163,166,247,250,355],[55,56],"rule-metadata",{"category":57,"diagnosticCodes":58,"docsUrl":59,"fix":60,"pack":61,"ruleId":62,"severity":63,"source":64,"sourceUrl":65},"hydration","NUXT0086","https:\u002F\u002Fnuxt.com\u002Fdocs\u002F4.x\u002Fapi\u002Fcomponents\u002Fclient-only","suggestion","vite-doctor\u002Fnuxt","nuxt\u002Fhydration\u002Frequire-clientonly-fallback","info","src\u002Frule-packs\u002Fnuxt\u002Frules\u002Fnuxt\u002Frequire-client-only-fallback.ts","https:\u002F\u002Fgithub.com\u002Fonmax\u002Fvite-doctor\u002Fblob\u002Fmain\u002Fsrc\u002Frule-packs\u002Fnuxt\u002Frules\u002Fnuxt\u002Frequire-client-only-fallback.ts",[67,68,70],"h2",{"id":69},"run-this-rule","Run this rule",[72,73,78],"pre",{"className":74,"code":75,"language":76,"meta":77,"style":77},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","pnpm nuxt doctor --extends auto,nuxt\u002Fstrict --rules nuxt\u002Fhydration\u002Frequire-clientonly-fallback\n","bash","",[79,80,81],"code",{"__ignoreMap":77},[82,83,86,90,94,97,100,103,106],"span",{"class":84,"line":85},"line",1,[82,87,89],{"class":88},"sBMFI","pnpm",[82,91,93],{"class":92},"sfazB"," nuxt",[82,95,96],{"class":92}," doctor",[82,98,99],{"class":92}," --extends",[82,101,102],{"class":92}," auto,nuxt\u002Fstrict",[82,104,105],{"class":92}," --rules",[82,107,108],{"class":92}," nuxt\u002Fhydration\u002Frequire-clientonly-fallback\n",[67,110,112],{"id":111},"why-it-matters","Why it matters",[114,115,116,117,120,121,124],"p",{},"On the server, and until the component mounts, ",[79,118,119],{},"\u003CClientOnly>"," renders only its fallback. Without a #fallback slot or a fallback, placeholder or fallback-tag prop that is an empty ",[79,122,123],{},"\u003Cspan>",", so the client-only content appears after hydration and pushes the surrounding layout.",[67,126,128],{"id":127},"recommended-fix","Recommended fix",[114,130,131,132,134,135,137],{},"Add a #fallback slot with a placeholder of the same size, such as a skeleton, or set fallback-tag with classes that reserve the space. Prefer server-rendered markup when the content does not need the browser. Doctor skips ",[79,133,119],{}," wrappers whose only children are Teleport or overlay components such as modals, dialogs, drawers and toasts, and ",[79,136,119],{}," with a v-bind object, because those can pass a fallback Doctor cannot see. This Rule is opinionated, so it is only in the Strict Preset.",[67,139,141],{"id":140},"useful-links","Useful links",[143,144,145],"ul",{},[146,147,148],"li",{},[149,150,153],"a",{"href":59,"rel":151},[152],"nofollow","Rule reference",[67,155,157],{"id":156},"example","Example",[159,160,162],"h3",{"id":161},"reserve-the-space-with-a-fallback","Reserve the space with a fallback",[114,164,165],{},"Before",[72,167,171],{"className":168,"code":169,"language":170,"meta":77,"style":77},"language-vue shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","\u003Ctemplate>\n  \u003CClientOnly>\n    \u003CSalesChart :data=\"data\" \u002F>\n  \u003C\u002FClientOnly>\n\u003C\u002Ftemplate>\n","vue",[79,172,173,186,197,227,237],{"__ignoreMap":77},[82,174,175,179,183],{"class":84,"line":85},[82,176,178],{"class":177},"sMK4o","\u003C",[82,180,182],{"class":181},"swJcz","template",[82,184,185],{"class":177},">\n",[82,187,189,192,195],{"class":84,"line":188},2,[82,190,191],{"class":177},"  \u003C",[82,193,194],{"class":181},"ClientOnly",[82,196,185],{"class":177},[82,198,200,203,206,209,213,216,219,222,224],{"class":84,"line":199},3,[82,201,202],{"class":177},"    \u003C",[82,204,205],{"class":181},"SalesChart",[82,207,208],{"class":177}," :",[82,210,212],{"class":211},"spNyl","data",[82,214,215],{"class":177},"=",[82,217,218],{"class":177},"\"",[82,220,212],{"class":221},"sTEyZ",[82,223,218],{"class":177},[82,225,226],{"class":177}," \u002F>\n",[82,228,230,233,235],{"class":84,"line":229},4,[82,231,232],{"class":177},"  \u003C\u002F",[82,234,194],{"class":181},[82,236,185],{"class":177},[82,238,240,243,245],{"class":84,"line":239},5,[82,241,242],{"class":177},"\u003C\u002F",[82,244,182],{"class":181},[82,246,185],{"class":177},[114,248,249],{},"After",[72,251,253],{"className":168,"code":252,"language":170,"meta":77,"style":77},"\u003Ctemplate>\n  \u003CClientOnly>\n    \u003CSalesChart :data=\"data\" \u002F>\n    \u003Ctemplate #fallback>\n      \u003CUSkeleton class=\"h-80 w-full\" \u002F>\n    \u003C\u002Ftemplate>\n  \u003C\u002FClientOnly>\n\u003C\u002Ftemplate>\n",[79,254,255,263,271,291,305,327,337,346],{"__ignoreMap":77},[82,256,257,259,261],{"class":84,"line":85},[82,258,178],{"class":177},[82,260,182],{"class":181},[82,262,185],{"class":177},[82,264,265,267,269],{"class":84,"line":188},[82,266,191],{"class":177},[82,268,194],{"class":181},[82,270,185],{"class":177},[82,272,273,275,277,279,281,283,285,287,289],{"class":84,"line":199},[82,274,202],{"class":177},[82,276,205],{"class":181},[82,278,208],{"class":177},[82,280,212],{"class":211},[82,282,215],{"class":177},[82,284,218],{"class":177},[82,286,212],{"class":221},[82,288,218],{"class":177},[82,290,226],{"class":177},[82,292,293,295,297,300,303],{"class":84,"line":229},[82,294,202],{"class":177},[82,296,182],{"class":181},[82,298,299],{"class":177}," #",[82,301,302],{"class":211},"fallback",[82,304,185],{"class":177},[82,306,307,310,313,316,318,320,323,325],{"class":84,"line":239},[82,308,309],{"class":177},"      \u003C",[82,311,312],{"class":181},"USkeleton",[82,314,315],{"class":211}," class",[82,317,215],{"class":177},[82,319,218],{"class":177},[82,321,322],{"class":92},"h-80 w-full",[82,324,218],{"class":177},[82,326,226],{"class":177},[82,328,330,333,335],{"class":84,"line":329},6,[82,331,332],{"class":177},"    \u003C\u002F",[82,334,182],{"class":181},[82,336,185],{"class":177},[82,338,340,342,344],{"class":84,"line":339},7,[82,341,232],{"class":177},[82,343,194],{"class":181},[82,345,185],{"class":177},[82,347,349,351,353],{"class":84,"line":348},8,[82,350,242],{"class":177},[82,352,182],{"class":181},[82,354,185],{"class":177},[356,357,358],"style",{},"html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}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 .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}",{"title":77,"searchDepth":188,"depth":188,"links":360},[361,362,363,364,365],{"id":69,"depth":188,"text":70},{"id":111,"depth":188,"text":112},{"id":127,"depth":188,"text":128},{"id":140,"depth":188,"text":141},{"id":156,"depth":188,"text":157,"children":366},[367],{"id":161,"depth":199,"text":162},"Finds \u003CClientOnly> components without a server fallback, which render an empty element on the server and shift the layout once their content mounts.",[58],"md","nuxt",{},{"title":374},"ClientOnly fallback","\u002Fnuxt\u002Frules\u002Fhydration\u002Frequire-clientonly-fallback","Add a #fallback slot with a placeholder of the same size, such as a skeleton, or set fallback-tag with classes that reserve the space. Prefer server-rendered markup when the content does not need the browser. Doctor skips \u003CClientOnly> wrappers whose only children are Teleport or overlay components such as modals, dialogs, drawers and toasts, and \u003CClientOnly> with a v-bind object, because those can pass a fallback Doctor cannot see. This Rule is opinionated, so it is only in the Strict Preset.",{"title":50,"description":368},"nuxt\u002Frules\u002Fhydration\u002Frequire-clientonly-fallback","On the server, and until the component mounts, \u003CClientOnly> renders only its fallback. Without a #fallback slot or a fallback, placeholder or fallback-tag prop that is an empty \u003Cspan>, so the client-only content appears after hydration and pushes the surrounding layout.","AwD-vivHripoSCAYIDxBi3Ef6dvVv-iSuHkmO8fsmM0",1795268803814]