From 4979ebb2f9db94fa291384213e4f37e4a58a294a Mon Sep 17 00:00:00 2001 From: Chris Nakamura Date: Mon, 10 Aug 2020 16:57:57 -0400 Subject: [PATCH] Improved regexp responsible for label extraction in Chrome (#1966) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Updated the regex query * Add changeset Co-authored-by: Mateusz BurzyƄski --- .changeset/blue-pianos-smell.md | 5 +++++ packages/core/src/jsx.js | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/blue-pianos-smell.md diff --git a/.changeset/blue-pianos-smell.md b/.changeset/blue-pianos-smell.md new file mode 100644 index 000000000..46395d055 --- /dev/null +++ b/.changeset/blue-pianos-smell.md @@ -0,0 +1,5 @@ +--- +"@emotion/core": patch +--- + +Fixed label extraction from the stack traces in Chrome in certain scenarios. This has affected only development builds. diff --git a/packages/core/src/jsx.js b/packages/core/src/jsx.js index 1e3ceeeff..e61fbe0dc 100644 --- a/packages/core/src/jsx.js +++ b/packages/core/src/jsx.js @@ -154,7 +154,7 @@ export const jsx: typeof React.createElement = function( if (error.stack) { // chrome let match = error.stack.match( - /at (?:Object\.|)jsx.*\n\s+at ([A-Z][A-Za-z$]+) / + /at (?:Object\.|Module\.|)jsx.*\n\s+at ([A-Z][A-Za-z$]+) / ) if (!match) { // safari and firefox