Skip to content

Commit 4f0cad2

Browse files
Attempt to inline deps
1 parent 69d653f commit 4f0cad2

File tree

1 file changed

+3
-10
lines changed
  • packages/x-charts-pro/src/internals/plugins/useChartProExport

1 file changed

+3
-10
lines changed

packages/x-charts-pro/src/internals/plugins/useChartProExport/exportImage.ts

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,9 @@ import { ChartImageExportOptions } from './useChartProExport.types';
55
import { defaultOnBeforeExport } from './defaults';
66

77
export const getDrawDocument = async () => {
8-
try {
9-
const module = await import('rasterizehtml');
10-
11-
return (module.default || module).drawDocument;
12-
} catch (error) {
13-
throw new Error(
14-
`MUI X Charts: Failed to import 'rasterizehtml' module. This dependency is mandatory when exporting a chart as an image. Make sure you have it installed as a dependency.`,
15-
{ cause: error },
16-
);
17-
}
8+
// Use the local TypeScript implementation instead of external dependency
9+
const { drawDocument } = await import('./rasterizeHtml');
10+
return drawDocument;
1811
};
1912

2013
export async function exportImage(

0 commit comments

Comments
 (0)