dosubot[bot] commented on issue #34681:
URL: https://github.com/apache/superset/issues/34681#issuecomment-3185635907

   <!-- Answer -->
   This error is most likely caused by a version mismatch among the deck.gl 
dependencies in Superset, which can cause webpack to resolve to a 
UMD/Node-style bundle that expects a Node.js `module` object to exist in the 
browser. Specifically, the legacy deck.gl plugin lists versions like 
`@deck.gl/aggregation-layers@^9.1.12`, `@deck.gl/core@^9.0.37`, 
`@deck.gl/layers@^9.0.38`, and `@deck.gl/react@^9.1.4`—these are not aligned, 
and the caret (`^`) allows npm/yarn to resolve to different minor/patch 
versions, which can trigger this issue if the resolved versions are not fully 
compatible or if one resolves to a UMD build instead of ESM. This is a common 
cause of the "ReferenceError: module is not defined" error in browser builds 
when a dependency expects a Node/CommonJS environment but is loaded in the 
browser instead 
[[source]](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/plugins/legacy-preset-chart-deckgl/package.json).
   
   To resolve this, make sure all deck.gl dependencies in your `package.json` 
are pinned to the exact same version (for example, `9.0.34` for all deck.gl 
packages), then delete your `node_modules` and lockfile, and reinstall. This 
will ensure webpack only bundles the ESM versions and avoids the UMD fallback 
that causes the error. There is no evidence of a fix for this in recent PRs or 
in the webpack config [[source]](https://github.com/apache/superset/pull/30786).
   
   
   <!-- Dosu Comment Footer -->
   *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).*
   
   ---
   <sup>How did I do? 
[Good](https://app.dosu.dev/response-feedback/22eeb27c-3e4b-4c78-9fca-bdf14c26d360?feedback_type=great_response)
 | 
[Irrelevant](https://app.dosu.dev/response-feedback/22eeb27c-3e4b-4c78-9fca-bdf14c26d360?feedback_type=irrelevant_answer)
 | 
[Incorrect](https://app.dosu.dev/response-feedback/22eeb27c-3e4b-4c78-9fca-bdf14c26d360?feedback_type=incorrect_sources)
 | 
[Verbose](https://app.dosu.dev/response-feedback/22eeb27c-3e4b-4c78-9fca-bdf14c26d360?feedback_type=too_verbose)
 | 
[Hallucination](https://app.dosu.dev/response-feedback/22eeb27c-3e4b-4c78-9fca-bdf14c26d360?feedback_type=hallucination)
 | [Report 
🐛](https://app.dosu.dev/response-feedback/22eeb27c-3e4b-4c78-9fca-bdf14c26d360?feedback_type=bug_report)
 | 
[Other](https://app.dosu.dev/response-feedback/22eeb27c-3e4b-4c78-9fca-bdf14c26d360?feedback_type=other)</sup>&nbsp;&nbsp;[![Chat
 with 
Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/a28d3c7e-a9d3-459e-9fb6-3a6f9ff4f357/ask?utm_source=githu
 b)&nbsp;[![Join 
Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share
 on 
X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/superset/issues/34681)


-- 
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: notifications-unsubscr...@superset.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscr...@superset.apache.org
For additional commands, e-mail: notifications-h...@superset.apache.org

Reply via email to