From 8b00d9816787a5257f51a0c78cc73c01d5a72015 Mon Sep 17 00:00:00 2001 From: Alex Kotliarskyi Date: Tue, 5 Jul 2016 09:37:00 -0700 Subject: [PATCH] Don't attempt symbolicating non-http(s) urls Summary: Looks like spaces in function names can happen, but the lib we use for parsing stacktraces doesn't support that. As result, when error is thrown in global scope, new JSC puts "global code" as function name, our parser chokes on it and thinks "global code@http://...." is a file name and sends it to packager. The packager can't resolve that URL and fails the whole symbolication request. Longer term fix here: https://github.com/errwischt/stacktrace-parser/pull/5 Reviewed By: astreet Differential Revision: D3516741 fbshipit-source-id: 4f2bb70084437ed9d37495cd775622a8c981fad1 --- react-packager/src/Server/index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/react-packager/src/Server/index.js b/react-packager/src/Server/index.js index c7ab61be..dadc7379 100644 --- a/react-packager/src/Server/index.js +++ b/react-packager/src/Server/index.js @@ -499,8 +499,10 @@ class Server { const sourceUrl = frame.file; // Skip `/debuggerWorker.js` which drives remote debugging because it // does not need to symbolication. + // Skip anything except http(s), because there is no support for that yet if (!urlIndexes.hasOwnProperty(sourceUrl) && - !sourceUrl.endsWith('/debuggerWorker.js')) { + !sourceUrl.endsWith('/debuggerWorker.js') && + sourceUrl.startsWith('http')) { urlIndexes[sourceUrl] = uniqueUrls.length; uniqueUrls.push(sourceUrl); }