richardfogaca opened a new pull request, #34690:
URL: https://github.com/apache/superset/pull/34690
## Bug: deck.gl aggregated charts fail with "ReferenceError: module is not
defined"
### Problem
All deck.gl aggregated chart types (Grid, Contour, Hexagon, Screengrid,
Heatmap, Calendar Heatmap) were failing to render with a "module is not
defined" error. This occurred because deck.gl's distribution files contain code
that references the Node.js `module` global, which doesn't exist in browser
environments.
### Root Cause
The deck.gl library's bundled JavaScript files in
`node_modules/@deck.gl/*/dist/*.js` contain references to `module.exports`,
expecting a CommonJS environment. When webpack processes these files for the
browser, the `module` global is undefined, causing a ReferenceError.
### Solution
Added a webpack rule using `imports-loader` to inject `var module = module
|| {exports: {}};` at the top of all deck.gl and luma.gl JavaScript files. This
ensures the `module` object exists before any code tries to access it,
preventing the runtime error.
### Testing
- Verified all affected deck.gl aggregated charts (Grid, Contour, Hexagon,
Screengrid, Heatmap, Calendar Heatmap) now render correctly
- Confirmed non-aggregated deck.gl charts (Arc, Path, etc.) continue to
work as expected
- No impact on build performance or bundle size
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]