{"record":{"id":"90f71000adc63000","repo":"withastro/astro","slug":"solid-devtools-requires-solid-devtools-as-a-peer","errorCode":null,"errorMessage":"Solid Devtools requires `solid-devtools` as a peer dependency, add it to your project.","messagePattern":"Solid Devtools requires `solid-devtools` as a peer dependency, add it to your project\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/integrations/solid/src/index.ts","lineNumber":39,"sourceCode":"\t\t\t\tkey?: string;\n\t\t\t\t/** Inject location attributes to jsx templates */\n\t\t\t\tjsxLocation?: boolean;\n\t\t\t\t/** Inject location information to component declarations */\n\t\t\t\tcomponentLocation?: boolean;\n\t\t  };\n};\ntype DevtoolsPlugin = (_options?: DevtoolsPluginOptions) => PluginOption;\n\nasync function getDevtoolsPlugin(logger: AstroIntegrationLogger, retrieve: boolean) {\n\tif (!retrieve) {\n\t\treturn null;\n\t}\n\n\ttry {\n\t\t// @ts-ignore\n\t\treturn (await import('solid-devtools/vite')).default as DevtoolsPlugin;\n\t} catch (_) {\n\t\tlogger.warn(\n\t\t\t'Solid Devtools requires `solid-devtools` as a peer dependency, add it to your project.',\n\t\t);\n\t\treturn null;\n\t}\n}\n\nfunction getViteConfiguration(\n\t{ include, exclude }: Options,\n\tdevtoolsPlugin: DevtoolsPlugin | null,\n\tsolidNoExternal: string[],\n) {\n\tconst plugins: PluginOption[] = [\n\t\tsolid({ include, exclude, ssr: true }),\n\t\tconfigEnvironmentPlugin(solidNoExternal),\n\t];\n\n\tif (devtoolsPlugin) {\n\t\tplugins.push(devtoolsPlugin({ autoname: true }));","sourceCodeStart":21,"sourceCodeEnd":57,"githubUrl":"https://github.com/withastro/astro/blob/52e6c34790cc8ac4e69e6135ace06049867e5c4a/packages/integrations/solid/src/index.ts#L21-L57","documentation":"When devtools: true is set on the Solid integration, it dynamically imports solid-devtools/vite to load the devtools Vite plugin. If that import fails (package not installed), getDevtoolsPlugin() catches the error, prints this warning, and returns null, so the build continues but without the devtools_autoname/babel plugin and without the 'import \"solid-devtools\"' page script.","triggerScenarios":" astro.config.mjs sets integrations: [solid({ devtools: true })] but solid-devtools is not in package.json dependencies/devDependencies, so await import('solid-devtools/vite') rejects and the catch branch logs the warning.","commonSituations":" Copying a config that enables devtools without copying the dependency; solid-devtools installed but not linked in pnpm/npm workspaces; monorepos where the package is added to the wrong package.json.","solutions":["Install the peer dependency in the project: npm install -D solid-devtools (or pnpm add -D solid-devtools).","Ensure it is added to the same package.json that owns the Astro config.","Restart the dev server; the warning should disappear and devtools annotations appear in the browser.","Alternatively set devtools: false (or remove it) if devtools are not wanted."],"exampleFix":"# before\n# package.json has no solid-devtools, but config uses:\n# solid({ devtools: true })\n\n# after\nnpm install -D solid-devtools\n# config stays: solid({ devtools: true })","handlingStrategy":"validation","validationCode":"import { access } from 'node:fs/promises';\nlet devtoolsInstalled = true;\ntry {\n  await access('node_modules/solid-devtools/package.json');\n} catch {\n  devtoolsInstalled = false;\n}\nconst safeOptions = devtoolsInstalled ? { devtools: true } : {};","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Install solid-devtools as a devDependency whenever devtools: true is set.","In monorepos, add it to the package.json that contains the Astro config.","Watch build logs after enabling devtools: the warning means the plugin silently did not load."],"tags":["solid","devtools","peer-dependency","missing-dependency"],"backgroundTag":"missing-peer-dependency","analyzedSha":"52e6c34790cc8ac4e69e6135ace06049867e5c4a","analyzedAt":"2026-08-18T18:48:03.901Z","contentChangedAt":"2026-08-18T18:48:03.901Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}