{"record":{"id":"7fede6311f541db6","repo":"facebook/react","slug":"more-than-one-external-source-map-detected-in-the","errorCode":null,"errorMessage":"More than one external source map detected in the source file; skipping \"${sourceMappingURL}\"","messagePattern":"More than one external source map detected in the source file; skipping \"(.+?)\"","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/react-devtools-shared/src/hooks/parseHookNames/loadSourceAndMetadata.js","lineNumber":239,"sourceCode":"        } else {\n          externalSourceMapURLs.push(sourceMappingURL);\n        }\n\n        // If the first source map we found wasn't a match, check for more.\n        sourceMappingURLMatch = withSyncPerfMeasurements(\n          'sourceMapRegex.exec(runtimeSourceCode)',\n          () => sourceMapRegex.exec(runtimeSourceCode),\n        );\n      }\n\n      if (hookSourceAndMetadata.sourceMapJSON === null) {\n        externalSourceMapURLs.forEach((sourceMappingURL, index) => {\n          if (index !== externalSourceMapURLs.length - 1) {\n            // Files with external source maps should only have a single source map.\n            // More than one result might indicate an edge case,\n            // like a string in the source code that matched our \"sourceMappingURL\" regex.\n            // We should just skip over cases like this.\n            console.warn(\n              `More than one external source map detected in the source file; skipping \"${sourceMappingURL}\"`,\n            );\n            return;\n          }\n\n          const {runtimeSourceURL} = hookSourceAndMetadata;\n          let url = sourceMappingURL;\n          if (!url.startsWith('http') && !url.startsWith('/')) {\n            // Resolve paths relative to the location of the file name\n            const lastSlashIdx = runtimeSourceURL.lastIndexOf('/');\n            if (lastSlashIdx !== -1) {\n              const baseURL = runtimeSourceURL.slice(\n                0,\n                runtimeSourceURL.lastIndexOf('/'),\n              );\n              url = `${baseURL}/${url}`;\n            }\n          }","sourceCodeStart":221,"sourceCodeEnd":257,"githubUrl":"https://github.com/facebook/react/blob/eafeac097ba51e1eab809c07102126bd5f8e5425/packages/react-devtools-shared/src/hooks/parseHookNames/loadSourceAndMetadata.js#L221-L257","documentation":"While parsing hook names, loadSourceAndMetadata (packages/react-devtools-shared/src/hooks/parseHookNames/loadSourceAndMetadata.js) scans runtime source code with a sourceMappingURL regex to find external source maps. Well-formed files have exactly one match; if the regex finds several (usually a string literal in the source that looks like a source-map comment, or a concatenated bundle), DevTools cannot tell which is real, so it skips all but the last one and warns per skipped URL. Hook-name resolution then proceeds with the surviving (last) map.","triggerScenarios":"The inspected bundle contains multiple strings matching the sourceMappingURL pattern — e.g. bundler/bootloader source code that embeds such strings, concatenated files, or code that documents source maps in string literals — and you use the 'parse hook names' feature in the Components panel.","commonSituations":"Debugging bundler-adjacent code, devtools-in-devtools setups, or libraries whose source legitimately contains 'sourceMappingURL' text; bundles produced by naive concatenation of individually mapped files.","solutions":["Verify the final bundle has a single //# sourceMappingURL comment at the very end (standard bundler output does).","If your source contains literal strings that match the pattern, ignore the warning — DevTools uses the last match, which is normally the real one.","Rebuild so source maps are inline or emitted once (avoid concatenating multiple already-mapped files without a final sourcemap merge)."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"// Before enabling 'parse hook names', sanity-check the bundle:\nconst matches = bundleSource.match(/^\\/\\/# sourceMappingURL=.*/gm) ?? [];\nif (matches.length > 1) {\n  // extra matches are likely string literals; the last one is used by DevTools\n  console.log('multiple sourceMappingURL candidates:', matches);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Ship bundles with exactly one //# sourceMappingURL comment at the end.","Use standard bundler source-map emission rather than concatenating mapped files by hand.","If your source legitimately contains 'sourceMappingURL' strings, expect and ignore the warning."],"tags":["react-devtools","source-maps","hook-names","bundler","dev-only"],"backgroundTag":"source-map-parsing","analyzedSha":"eafeac097ba51e1eab809c07102126bd5f8e5425","analyzedAt":"2026-08-21T22:01:08.818Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}