Skip to content

Commit

Permalink
[license] Use console.log for the error message on Codesandbox to a…
Browse files Browse the repository at this point in the history
…void rendering error (@arminmeh) (#15818)

Co-authored-by: Armin Mehinovic <[email protected]>
  • Loading branch information
github-actions[bot] and arminmeh authored Dec 10, 2024
1 parent 9a4e11d commit ac803d7
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion packages/x-license/src/utils/licenseErrorMessageUtils.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
/**
* Workaround for the codesadbox preview error.
*
* Once these issues are resolved
* https://github.com/mui/mui-x/issues/15765
* https://github.com/codesandbox/codesandbox-client/issues/8673
*
* `showError` can simply use `console.error` again.
*/
const isCodeSandbox =
typeof window !== 'undefined' && window.location.hostname.endsWith('.csb.app');

function showError(message: string[]) {
console.error(
// eslint-disable-next-line no-console
const logger = isCodeSandbox ? console.log : console.error;
logger(
[
'*************************************************************',
'',
Expand Down

0 comments on commit ac803d7

Please sign in to comment.