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 (#15814)
  • Loading branch information
arminmeh authored Dec 10, 2024
1 parent 05b5028 commit bc1f0f4
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 bc1f0f4

Please sign in to comment.