{"record":{"id":"6fcddd9a4254e537","repo":"facebook/react","slug":"96","errorCode":"96","errorMessage":"EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `${pluginName}`.","messagePattern":"EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `(.+?)`\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/react-native-renderer/src/legacy-events/EventPluginRegistry.js","lineNumber":49,"sourceCode":"const namesToPlugins: NamesToPlugins = {};\n\n/**\n * Recomputes the plugin list using the injected plugins and plugin ordering.\n *\n * @private\n */\nfunction recomputePluginOrdering(): void {\n  if (!eventPluginOrder) {\n    // Wait until an `eventPluginOrder` is injected.\n    return;\n  }\n  for (const pluginName in namesToPlugins) {\n    const pluginModule = namesToPlugins[pluginName];\n    // $FlowFixMe[incompatible-use] found when upgrading Flow\n    const pluginIndex = eventPluginOrder.indexOf(pluginName);\n\n    if (pluginIndex <= -1) {\n      throw new Error(\n        'EventPluginRegistry: Cannot inject event plugins that do not exist in ' +\n          `the plugin ordering, \\`${pluginName}\\`.`,\n      );\n    }\n\n    if (plugins[pluginIndex]) {\n      continue;\n    }\n\n    if (!pluginModule.extractEvents) {\n      throw new Error(\n        'EventPluginRegistry: Event plugins must implement an `extractEvents` ' +\n          `method, but \\`${pluginName}\\` does not.`,\n      );\n    }\n\n    plugins[pluginIndex] = pluginModule;\n    const publishedEvents = pluginModule.eventTypes;","sourceCodeStart":31,"sourceCodeEnd":67,"githubUrl":"https://github.com/facebook/react/blob/eafeac097ba51e1eab809c07102126bd5f8e5425/packages/react-native-renderer/src/legacy-events/EventPluginRegistry.js#L31-L67","documentation":"The legacy EventPluginRegistry builds a name-ordered plugin list: once injectEventPluginOrder is set, every plugin injected via injectEventPluginsByName must appear by name in that order array, or registration throws. The guard prevents plugins that would otherwise have no defined position in the dispatch pipeline.","triggerScenarios":"Calling injectEventPluginsByName({MyPlugin}) where 'MyPlugin' is not listed in the array passed to injectEventPluginOrder - including case mismatches and names injected before an order that omits them (recomputePluginOrdering runs on each injection).","commonSituations":"Custom legacy event plugins in RN forks; upgrading RN where the injected plugin order changed; typo'd or renamed plugin identifiers.","solutions":["Add the plugin's exact name to the eventPluginOrder array passed to injectEventPluginOrder.","Or stop injecting the unknown plugin module.","Check exact spelling and case between the two injections."],"exampleFix":"// before\ninjectEventPluginOrder([\n  'ResponderEventPlugin',\n  'ReactNativeBridgeEventPlugin',\n]);\ninjectEventPluginsByName({MyPlugin}); // throws\n\n// after\ninjectEventPluginOrder([\n  'ResponderEventPlugin',\n  'ReactNativeBridgeEventPlugin',\n  'MyPlugin',\n]);\ninjectEventPluginsByName({MyPlugin});","handlingStrategy":"validation","validationCode":"const eventPluginOrder = [\n  'ResponderEventPlugin',\n  'ReactNativeBridgeEventPlugin',\n];\nfor (const pluginName of Object.keys(pluginsToInject)) {\n  if (eventPluginOrder.indexOf(pluginName) === -1) {\n    throw new Error(\n      `Add '${pluginName}' to eventPluginOrder before injecting it`,\n    );\n  }\n}\ninjectEventPluginOrder(eventPluginOrder);\ninjectEventPluginsByName(pluginsToInject);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep the plugin names in injectEventPluginsByName and injectEventPluginOrder in lockstep.","Check exact spelling and case of plugin names on both sides.","After RN upgrades, re-verify the injected order still contains every custom plugin."],"tags":["react-native","legacy-events","event-plugins","registration"],"backgroundTag":"event-plugin-registration-mismatch","analyzedSha":"eafeac097ba51e1eab809c07102126bd5f8e5425","analyzedAt":"2026-08-21T22:01:08.818Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}