diff --git a/packages/x-license/src/utils/licenseErrorMessageUtils.ts b/packages/x-license/src/utils/licenseErrorMessageUtils.ts index 0b0385bf2d3cc..2edfba26a509e 100644 --- a/packages/x-license/src/utils/licenseErrorMessageUtils.ts +++ b/packages/x-license/src/utils/licenseErrorMessageUtils.ts @@ -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( [ '*************************************************************', '',