[playground] Capture Babel parsing errors
Before: <img width="1416" alt="Screenshot 2023-11-14 at 9 09 53 AM" src="https://github.com/facebook/react-forget/assets/565765/f53daf34-080a-4804-9a61-77c141c05d21"> After: <img width="1444" alt="Screenshot 2023-11-14 at 9 09 45 AM" src="https://github.com/facebook/react-forget/assets/565765/8861c266-9a49-4ff7-99cd-7240ca1750b1">
Sathya Gunasekaran committed
Nov 14, 2023 at 18:24 UTC
0821a57fa88021ffaca92043653c7ff8646f89ba
1 file changed
+6
compiler/apps/playground/components/Editor/EditorImpl.tsx
+6
@@ -84,6 +84,12 @@ function parseFunctions(
84
});
85
} catch (e) {
86
console.error(e);
87
+ CompilerError.throwInvalidJS({
88
+ reason: String(e),
89
+ description: null,
90
+ loc: null,
91
+ suggestions: null,
92
+ });
93
}
94
return items;
95
}