{"record":{"id":"abe7907758f50a5d","repo":"facebook/react","slug":"97","errorCode":"97","errorMessage":"EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `${pluginName}` does not.","messagePattern":"EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `(.+?)` does not\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/react-native-renderer/src/legacy-events/EventPluginRegistry.js","lineNumber":60,"sourceCode":"  }\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;\n    for (const eventName in publishedEvents) {\n      if (\n        !publishEventForPlugin(\n          publishedEvents[eventName],\n          pluginModule,\n          eventName,\n        )\n      ) {\n        throw new Error(\n          `EventPluginRegistry: Failed to publish event \\`${eventName}\\` for plugin \\`${pluginName}\\`.`,\n        );","sourceCodeStart":42,"sourceCodeEnd":78,"githubUrl":"https://github.com/facebook/react/blob/eafeac097ba51e1eab809c07102126bd5f8e5425/packages/react-native-renderer/src/legacy-events/EventPluginRegistry.js#L42-L78","documentation":"Every legacy event plugin must implement extractEvents, the hook the dispatch loop calls to build synthetic events for a top-level event; the registry throws at injection time when a module lacks it. The message names the offending plugin so the bad module is easy to spot.","triggerScenarios":"Injecting a plugin module without an extractEvents method (or with it renamed/mistyped) via injectEventPluginsByName - for example a partial port or a module namespace/default-export mixup that yields the wrong object shape.","commonSituations":"Porting plugins from newer event systems that don't use extractEvents; incomplete plugin implementations; broken transpilation or module resolution of plugin files.","solutions":["Implement extractEvents on the plugin module (returning null for events it wants to ignore).","Remove the module from injection if it is not meant to be a dispatch plugin.","Verify the object actually reaching the registry has the right shape (not a module namespace or the module's default)."],"exampleFix":"// before\nconst MyPlugin = {eventTypes: {/* ... */}};\n\n// after\nconst MyPlugin = {\n  eventTypes: {/* ... */},\n  extractEvents(topLevelType, targetInst, nativeEvent, eventTarget) {\n    return null;\n  },\n};","handlingStrategy":"type-guard","validationCode":null,"typeGuard":"const isLegacyPluginModule = module =>\n  module != null && typeof module.extractEvents === 'function';\nconst pluginsToInject = {MyPlugin};\nfor (const [name, module] of Object.entries(pluginsToInject)) {\n  if (!isLegacyPluginModule(module)) {\n    throw new Error(`Plugin '${name}' must implement extractEvents`);\n  }\n}\ninjectEventPluginsByName(pluginsToInject);","tryCatchPattern":null,"preventionTips":["Implement extractEvents on every plugin module before injecting (return null to ignore).","Confirm the injected object is the plugin itself, not a module namespace or default export mixup.","Mirror an existing plugin's shape when porting from another event system."],"tags":["react-native","legacy-events","event-plugins","interface"],"backgroundTag":"event-plugin-registration-mismatch","analyzedSha":"eafeac097ba51e1eab809c07102126bd5f8e5425","analyzedAt":"2026-08-21T22:01:08.818Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}