Skip to content

Commit e42bb98

Browse files
authored
fix(ag-grid): Change how the license key is set (#1218)
- We were breaking webpack builds with the `const { env } = import.meta` call - Use `import.meta.env?.` directly - Tested using a webpack project importing the plugin
1 parent 2084cf5 commit e42bb98

1 file changed

Lines changed: 3 additions & 8 deletions

File tree

plugins/ag-grid/src/js/src/AgGridPlugin.ts

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,9 @@ import type { dh } from '@deephaven/jsapi-types';
44
import { LicenseManager } from '@ag-grid-enterprise/core';
55
import { AgGridWidget } from './AgGridWidget';
66

7-
try {
8-
const { env } = import.meta;
9-
const key = env?.VITE_AG_GRID_LICENSE_KEY ?? '';
10-
if (key != null && key !== '') {
11-
LicenseManager.setLicenseKey(key);
12-
}
13-
} catch (error) {
14-
// We can just ignore this error if the license key is not set or invalid. AG Grid will log an error, and consumers should be adding their own license key.
7+
const key = import.meta.env?.VITE_AG_GRID_LICENSE_KEY ?? '';
8+
if (key != null && key !== '') {
9+
LicenseManager.setLicenseKey(key);
1510
}
1611

1712
export const AgGridPlugin: WidgetPlugin<dh.Widget> = {

0 commit comments

Comments
 (0)