You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "chlonn (via GitHub)" <gi...@apache.org> on 2025/08/18 08:10:17 UTC

[I] build: d3-scale@4 causes runtime ReferenceError: module is not defined [superset]

chlonn opened a new issue, #34730:
URL: https://github.com/apache/superset/issues/34730

   ### Bug description
   
   When @superset-ui/core resolves to d3-scale@4, the dev build fails at runtime with:
   
   ### Screenshots/recordings
   
   <img width="1272" height="559" alt="Image" src="https://github.com/user-attachments/assets/bb966393-01a5-42f6-8613-2b550e41e2da" />
   
   ### Superset version
   
   master / latest-dev
   
   ### Python version
   
   3.9
   
   ### Node version
   
   16
   
   ### Browser
   
   Chrome
   
   ### Additional context
   
   _No response_
   
   ### Checklist
   
   - [x] I have searched Superset docs and Slack and didn't find a solution to my problem.
   - [x] I have searched the GitHub issue tracker and didn't find a similar bug report.
   - [x] I have checked Superset's logs for errors and if I found a relevant Python stacktrace, I included it here as text in the "additional context" section.


-- 
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-unsubscribe@superset.apache.org.apache.org

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


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


Re: [I] build: d3-scale@4 causes runtime ReferenceError: module is not defined [superset]

Posted by "chlonn (via GitHub)" <gi...@apache.org>.
chlonn commented on issue #34730:
URL: https://github.com/apache/superset/issues/34730#issuecomment-3198942079

   I currently managed to compile successfully by referring to [[this issue](https://github.com/apache/superset/issues/28557)](#).  


-- 
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-unsubscribe@superset.apache.org

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


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


Re: [I] build: d3-scale@4 causes runtime ReferenceError: module is not defined [superset]

Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on issue #34730:
URL: https://github.com/apache/superset/issues/34730#issuecomment-3197802319

   If doing this ^^^ changes the package-lock.json file for some reason (bumping a sub-dependency or something... I'm not sure, as I haven't encountered this) then feel free to open a PR with the changes.


-- 
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-unsubscribe@superset.apache.org

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


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


Re: [I] build: d3-scale@4 causes runtime ReferenceError: module is not defined [superset]

Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas commented on issue #34730:
URL: https://github.com/apache/superset/issues/34730#issuecomment-3207619608

   Cool! We'll call this one case-closed then, but let us know if it needs revisiting!


-- 
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-unsubscribe@superset.apache.org

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


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


Re: [I] build: d3-scale@4 causes runtime ReferenceError: module is not defined [superset]

Posted by "dosubot[bot] (via GitHub)" <gi...@apache.org>.
dosubot[bot] commented on issue #34730:
URL: https://github.com/apache/superset/issues/34730#issuecomment-3195594675

   <!-- Greeting -->
   Hi @chlonn! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the superset team.
   
   <!-- Answer -->
   This error is happening because d3-scale v4 switched to ES modules by adding `"type": "module"` in its package, which can break builds expecting CommonJS modules and result in `ReferenceError: module is not defined` at runtime if your build tooling isn't configured for ESM compatibility. The upgrade to d3-scale@4 was made very recently in Superset's @superset-ui/core dependency ([PR #31534](https://github.com/apache/superset/pull/31534)), and there isn't any documented workaround or code-level fix for this issue in the repo yet.
   
   To work around this, you can try pinning d3-scale to v3 in your dependencies, or update your build configuration (webpack, Babel, etc.) to fully support ESM packages. If you need to revert, set d3-scale to `^3.3.0` in your package.json and run a clean install. If you want to use v4, make sure your build tools are set up for ESM imports throughout your frontend stack.
   
   Let me know if you need help with specific build config changes or troubleshooting the pinning process.
   
   
   <!-- 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/366f2c76-7a85-4602-89e7-95ee8d5c65c7?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/366f2c76-7a85-4602-89e7-95ee8d5c65c7?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/366f2c76-7a85-4602-89e7-95ee8d5c65c7?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/366f2c76-7a85-4602-89e7-95ee8d5c65c7?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/366f2c76-7a85-4602-89e7-95ee8d5c65c7?feedback_type=hallucination) | [Report šŸ›](https://app.dosu.dev/response-feedback/366f2c76-7a85-4602-89e7-95ee8d5c65c7?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/366f2c76-7a85-4602-89e7-95ee8d5c65c7?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/34730)


-- 
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-unsubscribe@superset.apache.org

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


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


Re: [I] build: d3-scale@4 causes runtime ReferenceError: module is not defined [superset]

Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas closed issue #34730: build: d3-scale@4 causes runtime ReferenceError: module is not defined
URL: https://github.com/apache/superset/issues/34730


-- 
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-unsubscribe@superset.apache.org

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


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


Re: [I] build: d3-scale@4 causes runtime ReferenceError: module is not defined [superset]

Posted by "msyavuz (via GitHub)" <gi...@apache.org>.
msyavuz commented on issue #34730:
URL: https://github.com/apache/superset/issues/34730#issuecomment-3196172146

   I remember encountering something like this, it should be fixed by running `npm ci` in a clean repo. Let me know if that helps, if not we might have a dependency issue there


-- 
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-unsubscribe@superset.apache.org

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


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