[{"data":1,"prerenderedAt":225},["ShallowReactive",2],{"navigation_docs":3,"rule-content-\u002Fpackage\u002Frules\u002Fdependencies\u002Fno-duplicate-singleton":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":214,"diagnosticCodes":215,"docsUrl":59,"extension":216,"fix":60,"framework":217,"meta":218,"navigation":219,"pack":61,"path":221,"recommendedReplacement":123,"ruleId":62,"seo":222,"severity":63,"source":64,"sourceUrl":65,"stem":223,"why":116,"__hash__":224},"rules\u002Fpackage\u002Frules\u002Fdependencies\u002Fno-duplicate-singleton.md","Install one copy of each singleton package",{"type":52,"value":53,"toc":205},"minimark",[54,66,71,109,113,117,121,124,128,140,144,149,152,164,167,201],[55,56],"rule-metadata",{"category":57,"diagnosticCodes":58,"docsUrl":59,"fix":60,"pack":61,"ruleId":62,"severity":63,"source":64,"sourceUrl":65},"dependencies","PKG0008","https:\u002F\u002Fpnpm.io\u002Fsettings#overrides","suggestion","vite-doctor\u002Fpackage","package\u002Fno-duplicate-singleton","warn","src\u002Frule-packs\u002Fpackage\u002Frules\u002Fno-duplicate-singleton.ts","https:\u002F\u002Fgithub.com\u002Fonmax\u002Fvite-doctor\u002Fblob\u002Fmain\u002Fsrc\u002Frule-packs\u002Fpackage\u002Frules\u002Fno-duplicate-singleton.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 vite-doctor . --extends package\u002Frecommended --rules package\u002Fno-duplicate-singleton\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"," vite-doctor",[82,95,96],{"class":92}," .",[82,98,99],{"class":92}," --extends",[82,101,102],{"class":92}," package\u002Frecommended",[82,104,105],{"class":92}," --rules",[82,107,108],{"class":92}," package\u002Fno-duplicate-singleton\n",[67,110,112],{"id":111},"why-it-matters","Why it matters",[114,115,116],"p",{},"Two versions of a singleton are two module instances. Vue, Pinia, Nuxt and React keep their state per instance, so code from one copy cannot see the other's injections, stores or app context, and h3 and Drizzle reject objects created by the other copy. A lockfile resolves the second copy when one package pins a version or a range that excludes the app's.",[67,118,120],{"id":119},"recommended-fix","Recommended fix",[114,122,123],{},"Update the package that resolves the extra version so it accepts the version the rest of the install uses, ideally as a peer, or add a pnpm override for that version and run pnpm install. Doctor reports each duplicate where it enters the workspace, at the package.json entry that leads to it.",[67,125,127],{"id":126},"useful-links","Useful links",[129,130,131],"ul",{},[132,133,134],"li",{},[135,136,139],"a",{"href":59,"rel":137},[138],"nofollow","Rule reference",[67,141,143],{"id":142},"example","Example",[145,146,148],"h3",{"id":147},"override-a-transitive-pin-to-the-apps-vue","Override a transitive pin to the app's Vue",[114,150,151],{},"Before",[72,153,157],{"className":154,"code":155,"language":156,"meta":77,"style":77},"language-yaml shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","# pnpm-lock.yaml resolves vue 3.5.44 and, through old-ui, vue 3.4.0\n","yaml",[79,158,159],{"__ignoreMap":77},[82,160,161],{"class":84,"line":85},[82,162,155],{"class":163},"sHwdD",[114,165,166],{},"After",[72,168,170],{"className":154,"code":169,"language":156,"meta":77,"style":77},"# pnpm-workspace.yaml\noverrides:\n  vue: 3.5.44\n",[79,171,172,177,188],{"__ignoreMap":77},[82,173,174],{"class":84,"line":85},[82,175,176],{"class":163},"# pnpm-workspace.yaml\n",[82,178,180,184],{"class":84,"line":179},2,[82,181,183],{"class":182},"swJcz","overrides",[82,185,187],{"class":186},"sMK4o",":\n",[82,189,191,194,197],{"class":84,"line":190},3,[82,192,193],{"class":182},"  vue",[82,195,196],{"class":186},":",[82,198,200],{"class":199},"sbssI"," 3.5.44\n",[202,203,204],"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 .sHwdD, html code.shiki .sHwdD{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic}html pre.shiki code .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}",{"title":77,"searchDepth":179,"depth":179,"links":206},[207,208,209,210,211],{"id":69,"depth":179,"text":70},{"id":111,"depth":179,"text":112},{"id":119,"depth":179,"text":120},{"id":126,"depth":179,"text":127},{"id":142,"depth":179,"text":143,"children":212},[213],{"id":147,"depth":190,"text":148},"Read pnpm-lock.yaml and find workspace packages and apps whose install reaches two versions of the same major of a package the app must load once, such as vue, nuxt, nitro, h3, vite, react or drizzle-orm. Add packages with the singletons option.",[58],"md","package",{},{"title":220},"Duplicate singletons","\u002Fpackage\u002Frules\u002Fdependencies\u002Fno-duplicate-singleton",{"title":50,"description":214},"package\u002Frules\u002Fdependencies\u002Fno-duplicate-singleton","INKFpSl3xqS_14iBnhWIP2wMLBRHdVAyHqUTmrXLm_Q",1795268785783]