{"record":{"id":"a5d69e355d1373b2","repo":"withastro/astro","slug":"colors-bold-plugin-0-not-applied","errorCode":null,"errorMessage":"${colors.bold(plugin[0])} not applied.","messagePattern":"(.+?) not applied\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/integrations/mdx/src/utils.ts","lineNumber":96,"sourceCode":"\t\t\t// @ts-expect-error `parse` return types is incompatible but it should work in runtime\n\t\t\testree: {\n\t\t\t\t...parse(jsString, acornOpts),\n\t\t\t\ttype: 'Program',\n\t\t\t\tsourceType: 'module',\n\t\t\t},\n\t\t},\n\t};\n}\n\nexport function ignoreStringPlugins(plugins: any[], logger: AstroIntegrationLogger): PluggableList {\n\tlet validPlugins: PluggableList = [];\n\tlet hasInvalidPlugin = false;\n\tfor (const plugin of plugins) {\n\t\tif (typeof plugin === 'string') {\n\t\t\tlogger.warn(`${colors.bold(plugin)} not applied.`);\n\t\t\thasInvalidPlugin = true;\n\t\t} else if (Array.isArray(plugin) && typeof plugin[0] === 'string') {\n\t\t\tlogger.warn(`${colors.bold(plugin[0])} not applied.`);\n\t\t\thasInvalidPlugin = true;\n\t\t} else {\n\t\t\tvalidPlugins.push(plugin);\n\t\t}\n\t}\n\tif (hasInvalidPlugin) {\n\t\tlogger.warn(\n\t\t\t`To inherit Markdown plugins in MDX, please use explicit imports in your config instead of \"strings.\" See Markdown docs: https://docs.astro.build/en/guides/markdown-content/#markdown-plugins`,\n\t\t);\n\t}\n\treturn validPlugins;\n}\n","sourceCodeStart":78,"sourceCodeEnd":109,"githubUrl":"https://github.com/withastro/astro/blob/52e6c34790cc8ac4e69e6135ace06049867e5c4a/packages/integrations/mdx/src/utils.ts#L78-L109","documentation":"Same MDX string-plugin filter as the bare-string case, but for the tuple form: an entry like ['remark-gfm', {option: true}] whose first element is a string. ignoreStringPlugins() treats a tuple with a string head exactly like a bare string, because the plugin implementation still cannot be resolved by name in the MDX compile pipeline, and drops the whole tuple including its options.","triggerScenarios":" markdown.remarkPlugins or markdown.rehypePlugins contains an Array whose [0] is a string, e.g. rehypePlugins: [['rehype-external-links', { target: '_blank' }]], with @astrojs/mdx installed. The Array.isArray(plugin) && typeof plugin[0] === 'string' branch fires and the entry is excluded from validPlugins.","commonSituations":" Migrating configs that used the ['plugin-name', options] string-tuple convention; option-carrying plugins (autolink headings, external links, katex) defined by name; presets copied from unified/remark documentation that allow string require-style references.","solutions":["Import the plugin function and keep it as the tuple head: import rehypeExternalLinks from 'rehype-external-links'; rehypePlugins: [[rehypeExternalLinks, { target: '_blank' }]].","Repeat for every tuple whose first element is a string until the warning stops on build.","Run astro build or astro dev and verify the follow-up 'To inherit Markdown plugins in MDX...' warning no longer appears."],"exampleFix":"// before\nimport defineConfig from 'astro/config';\nexport default defineConfig({\n  markdown: { rehypePlugins: [['rehype-external-links', { target: '_blank' }]] },\n});\n\n// after\nimport rehypeExternalLinks from 'rehype-external-links';\nexport default defineConfig({\n  markdown: { rehypePlugins: [[rehypeExternalLinks, { target: '_blank' }]] },\n});","handlingStrategy":"type-guard","validationCode":"const isTuplePlugin = (p: unknown): boolean =>\n  Array.isArray(p) && typeof p[0] === 'function';\nconst badTuples = plugins.filter((p) => Array.isArray(p) && typeof p[0] !== 'function');","typeGuard":"const isPluginWithOptions = (\n  p: unknown,\n): p is [Plugin, Record<string, unknown>] =>\n  Array.isArray(p) && typeof p[0] === 'function' && typeof p[1] === 'object';","tryCatchPattern":null,"preventionTips":["Keep the imported function as the first tuple element and options as the second.","Lint configs with a custom rule or a startup check that rejects string-headed tuples.","Search the repo for quoted plugin names inside markdown config arrays during upgrades."],"tags":["mdx","rehype","remark","plugins","tuple-options","config"],"backgroundTag":"invalid-plugin-config","analyzedSha":"52e6c34790cc8ac4e69e6135ace06049867e5c4a","analyzedAt":"2026-08-18T18:48:03.901Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}