{"record":{"id":"0408e55d91f3cd5d","repo":"facebook/docusaurus","slug":"you-site-uses-the-vercel-analytics-plugin-with-a-c","errorCode":null,"errorMessage":"You site uses the Vercel Analytics plugin with a custom plugin id (name=${options.id}).\n      But this plugin is only supposed to be used at most once per site. Therefore providing a custom plugin id is unsupported.","messagePattern":"You site uses the Vercel Analytics plugin with a custom plugin id \\(name=(.+?)\\)\\.\n      But this plugin is only supposed to be used at most once per site\\. Therefore providing a custom plugin id is unsupported\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/docusaurus-plugin-vercel-analytics/src/options.ts","lineNumber":29,"sourceCode":"\nexport type PluginOptions = {\n  id: string;\n  mode: 'auto' | 'production' | 'development' | undefined;\n  debug: boolean | undefined;\n};\n\nexport type Options = Partial<PluginOptions>;\n\nconst pluginOptionsSchema = Joi.object<PluginOptions>({\n  mode: Joi.string().valid('auto', 'production', 'development').optional(),\n  debug: Joi.boolean().optional(),\n});\n\n// We can't validate this through the schema\n// Docusaurus core auto registers the id field to the schema already\nfunction ensureNoMultiInstance(options: Options) {\n  if (options?.id && options.id !== DEFAULT_PLUGIN_ID) {\n    throw new Error(\n      logger.interpolate`You site uses the Vercel Analytics plugin with a custom plugin id (name=${options.id}).\n      But this plugin is only supposed to be used at most once per site. Therefore providing a custom plugin id is unsupported.`,\n    );\n  }\n}\n\nexport function validateOptions({\n  validate,\n  options,\n}: OptionValidationContext<Options, PluginOptions>): PluginOptions {\n  ensureNoMultiInstance(options);\n  return validate(pluginOptionsSchema, options);\n}\n","sourceCodeStart":11,"sourceCodeEnd":43,"githubUrl":"https://github.com/facebook/docusaurus/blob/3f483e80e326cc646b54b83d564b3f0c4881b9a6/packages/docusaurus-plugin-vercel-analytics/src/options.ts#L11-L43","documentation":"Thrown by ensureNoMultiInstance in plugin-vercel-analytics when the plugin is registered with an id other than DEFAULT_PLUGIN_ID ('default'). Vercel Analytics injects a single global script, so multiple instances are unsupported and a custom id (which Docusaurus uses to disambiguate multi-instance plugins) is rejected at option validation time. The message is built with logger.interpolate to highlight the offending id.","triggerScenarios":"Registering the plugin twice, or once with an explicit id: ['@docusaurus/plugin-vercel-analytics', {id:'secondary'}].","commonSituations":"Copy-pasting a multi-instance registration pattern; programmatic config generation that auto-assigns ids; misunderstanding that this analytics plugin is inherently single-instance.","solutions":["Register the plugin once without an id (let it default).","Remove the duplicate registration if it appears in both presets and plugins.","Rebuild to confirm."],"exampleFix":"// before\nplugins: [\n  ['@docusaurus/plugin-vercel-analytics', { id: 'analytics2' }],\n]\n// after\nplugins: [\n  '@docusaurus/plugin-vercel-analytics',\n]","handlingStrategy":"validation","validationCode":"const vaPlugins = (config.plugins ?? []).filter(p =>\n  (Array.isArray(p) ? p[0] : p) === '@docusaurus/plugin-vercel-analytics');\nif (vaPlugins.some(p => Array.isArray(p) && p[1]?.id && p[1].id !== 'default')) {\n  throw new Error('vercel-analytics must use the default id');\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Treat analytics plugins as single-instance; never assign a custom id.","Review both presets and plugins arrays for duplicates."],"tags":["analytics","vercel","plugin-instance","config-validation"],"backgroundTag":null,"analyzedSha":"3f483e80e326cc646b54b83d564b3f0c4881b9a6","analyzedAt":"2026-08-12T13:25:04.382Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}