[{"data":1,"prerenderedAt":288},["ShallowReactive",2],{"navigation_docs":3,"diagnostic-content-NUXT0082":44},[4,8,12,16,20,24,28,32,36,40],{"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},"Pinia","\u002Fpinia","9.pinia",{"id":45,"title":46,"body":47,"category":53,"code":276,"description":277,"docsUrl":54,"extension":278,"fix":279,"framework":280,"meta":281,"navigation":282,"pack":56,"path":283,"ruleId":57,"rulePath":58,"seo":284,"severity":59,"source":60,"sourceUrl":61,"stem":285,"why":286,"__hash__":287},"diagnostics\u002Fdiagnostics\u002FNUXT0082.md","NUXT0082: Resolve module runtime paths with createResolver",{"type":48,"value":49,"toc":265},"minimark",[50,62,67,76,80,90,94,99,102,137,140,201,205,208,233,237,249,253,261],[51,52],"rule-metadata",{"category":53,"docsUrl":54,"fix":55,"pack":56,"ruleId":57,"rulePath":58,"severity":59,"source":60,"sourceUrl":61},"modules","https:\u002F\u002Fnuxt.com\u002Fdocs\u002F4.x\u002Fapi\u002Fkit\u002Fresolving#createresolver","safe","vite-doctor\u002Fnuxt","nuxt\u002Fmodule\u002Fresolve-runtime-paths","\u002Fnuxt\u002Frules\u002Fmodule\u002Fresolve-runtime-paths","error","src\u002Frule-packs\u002Fnuxt\u002Frules\u002Fnuxt\u002Fmodule-resolve-runtime-paths.ts","https:\u002F\u002Fgithub.com\u002Fonmax\u002Fvite-doctor\u002Fblob\u002Fmain\u002Fsrc\u002Frule-packs\u002Fnuxt\u002Frules\u002Fnuxt\u002Fmodule-resolve-runtime-paths.ts",[63,64,66],"h2",{"id":65},"why-it-happens","Why it happens",[68,69,70,71,75],"p",{},"@nuxt\u002Fkit does not resolve relative paths against the module file. Nuxt resolves them later against the consuming project's rootDir or the process working directory, so a module that works in its playground breaks once it is installed from node_modules. ",[72,73,74],"code",{},"createResolver(import.meta.url)"," resolves paths from the module file instead. For local modules in modules\u002F, Doctor only reports paths that exist next to the module and not in the project.",[63,77,79],{"id":78},"fix","Fix",[68,81,82,83,85,86,89],{},"Create a resolver with ",[72,84,74],{}," and pass resolver.",[72,87,88],{},"resolve('.\u002Fruntime\u002F...')"," to kit helpers.",[63,91,93],{"id":92},"example","Example",[95,96,98],"h3",{"id":97},"resolve-runtime-paths-from-the-module-file","Resolve runtime paths from the module file",[68,100,101],{},"Before",[103,104,109],"pre",{"className":105,"code":106,"language":107,"meta":108,"style":108},"language-ts shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","addPlugin('.\u002Fruntime\u002Fplugin')\n","ts","",[72,110,111],{"__ignoreMap":108},[112,113,116,120,124,128,132,134],"span",{"class":114,"line":115},"line",1,[112,117,119],{"class":118},"s2Zo4","addPlugin",[112,121,123],{"class":122},"sTEyZ","(",[112,125,127],{"class":126},"sMK4o","'",[112,129,131],{"class":130},"sfazB",".\u002Fruntime\u002Fplugin",[112,133,127],{"class":126},[112,135,136],{"class":122},")\n",[68,138,139],{},"After",[103,141,143],{"className":105,"code":142,"language":107,"meta":108,"style":108},"const resolver = createResolver(import.meta.url)\naddPlugin(resolver.resolve('.\u002Fruntime\u002Fplugin'))\n",[72,144,145,177],{"__ignoreMap":108},[112,146,147,151,154,157,160,162,166,169,172,174],{"class":114,"line":115},[112,148,150],{"class":149},"spNyl","const",[112,152,153],{"class":122}," resolver ",[112,155,156],{"class":126},"=",[112,158,159],{"class":118}," createResolver",[112,161,123],{"class":122},[112,163,165],{"class":164},"s7zQu","import",[112,167,168],{"class":126},".",[112,170,171],{"class":122},"meta",[112,173,168],{"class":126},[112,175,176],{"class":122},"url)\n",[112,178,180,182,185,187,190,192,194,196,198],{"class":114,"line":179},2,[112,181,119],{"class":118},[112,183,184],{"class":122},"(resolver",[112,186,168],{"class":126},[112,188,189],{"class":118},"resolve",[112,191,123],{"class":122},[112,193,127],{"class":126},[112,195,131],{"class":130},[112,197,127],{"class":126},[112,199,200],{"class":122},"))\n",[63,202,204],{"id":203},"verify-the-fix","Verify the fix",[68,206,207],{},"Run only this rule after editing so the report stays focused on the diagnostic you are closing:",[103,209,213],{"className":210,"code":211,"language":212,"meta":108,"style":108},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","pnpm nuxt doctor --rules nuxt\u002Fmodule\u002Fresolve-runtime-paths\n","bash",[72,214,215],{"__ignoreMap":108},[112,216,217,221,224,227,230],{"class":114,"line":115},[112,218,220],{"class":219},"sBMFI","pnpm",[112,222,223],{"class":130}," nuxt",[112,225,226],{"class":130}," doctor",[112,228,229],{"class":130}," --rules",[112,231,232],{"class":130}," nuxt\u002Fmodule\u002Fresolve-runtime-paths\n",[63,234,236],{"id":235},"useful-links","Useful links",[238,239,240],"ul",{},[241,242,243],"li",{},[244,245,248],"a",{"href":54,"rel":246},[247],"nofollow","Upstream docs",[63,250,252],{"id":251},"related-rule","Related rule",[238,254,255],{},[241,256,257],{},[244,258,259],{"href":58},[72,260,57],{},[262,263,264],"style",{},"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 .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}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 .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}",{"title":108,"searchDepth":179,"depth":179,"links":266},[267,268,269,273,274,275],{"id":65,"depth":179,"text":66},{"id":78,"depth":179,"text":79},{"id":92,"depth":179,"text":93,"children":270},[271],{"id":97,"depth":272,"text":98},3,{"id":203,"depth":179,"text":204},{"id":235,"depth":179,"text":236},{"id":251,"depth":179,"text":252},"NUXT0082","Finds relative string paths passed to @nuxt\u002Fkit helpers such as addPlugin, addComponent, addComponentsDir, addImportsDir, addServerHandler, addServerPlugin, and addLayout in Nuxt module code.","md","Create a resolver with createResolver(import.meta.url) and pass resolver.resolve('.\u002Fruntime\u002F...') to kit helpers.","nuxt",{},true,"\u002Fdiagnostics\u002Fnuxt0082",{"title":46,"description":277},"diagnostics\u002FNUXT0082","@nuxt\u002Fkit does not resolve relative paths against the module file. Nuxt resolves them later against the consuming project's rootDir or the process working directory, so a module that works in its playground breaks once it is installed from node_modules. createResolver(import.meta.url) resolves paths from the module file instead. For local modules in modules\u002F, Doctor only reports paths that exist next to the module and not in the project.","yPGB3LSdUJD1lbIY5gyJyibYgL2RxIwWs06ibSxmx4s",1791309502183]