mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-06-16 21:06:35 +08:00
fix(client): don't display act error in fcc console (#53410)
This commit is contained in:
parent
933bbe7758
commit
293e2437f7
@ -209,6 +209,8 @@ const mountFrame =
|
||||
};
|
||||
};
|
||||
|
||||
const actRE = new RegExp(/act\(\.\.\.\) is not supported in production builds/);
|
||||
|
||||
const updateProxyConsole =
|
||||
(proxyLogger?: ProxyLogger) => (frameContext: Context) => {
|
||||
// window does not exist if the preview is hidden, so we have to check.
|
||||
@ -248,7 +250,9 @@ const updateProxyConsole =
|
||||
frameContext.window.console.error = function proxyWarn(
|
||||
...args: string[]
|
||||
) {
|
||||
proxyLogger(args.map((arg: string) => utilsFormat(arg)).join(' '));
|
||||
if (args.every(arg => !actRE.test(arg))) {
|
||||
proxyLogger(args.map((arg: string) => utilsFormat(arg)).join(' '));
|
||||
}
|
||||
return oldError(...(args as []));
|
||||
};
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user