Skip to content

Commit

Permalink
fix(playground): avoid stringifying invalid console messages (#11150)
Browse files Browse the repository at this point in the history
  • Loading branch information
caugner authored May 21, 2024
1 parent 95ea0da commit 90072c8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion client/src/playground/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -138,13 +138,15 @@ export default function Playground() {
) {
setVConsole((vConsole) => [...vConsole, { prop, message }]);
} else {
const warning = "[Playground] Unsupported console message";
setVConsole((vConsole) => [
...vConsole,
{
prop: "warn",
message: `[Playground] Unsupported console message: ${JSON.stringify({ prop, message }, null, 2)}`,
message: `${warning} (see browser console)`,
},
]);
console.warn(warning, { prop, message });
}
} else if (typ === "ready") {
updatePlayIframe(iframe.current, getEditorContent());
Expand Down

0 comments on commit 90072c8

Please sign in to comment.