mbostock/rollup-side-effect-bug — explained in plain English
Analysis updated 2026-08-03 · repo last pushed 2024-06-03
Reproduce a Rollup tree-shaking bug where the sideEffects flag causes code to be incorrectly removed.
Confirm that removing the sideEffects declaration from a package config resolves the issue.
Provide maintainers a clear diagnostic example to investigate and fix the underlying bug.
| mbostock/rollup-side-effect-bug | 00kaku/gallery-slider-block | 0verflowme/weirdhta | |
|---|---|---|---|
| Language | JavaScript | JavaScript | JavaScript |
| Last pushed | 2024-06-03 | 2021-05-19 | 2022-06-16 |
| Maintenance | Dormant | Dormant | Dormant |
| Setup difficulty | easy | easy | moderate |
| Complexity | 1/5 | 2/5 | 2/5 |
| Audience | developer | general | developer |
Figures from each repo's GitHub metadata at analysis time.
Requires Node.js and Rollup installed to run the reproduction commands.
This repository is a small test case that reproduces a specific bug in a popular JavaScript build tool called Rollup. The project exists to prove that something is going wrong when Rollup processes a package setting called sideEffects, which is a flag developers use to tell build tools which files in their project have meaningful side effects (like modifying global state) and which are safe to delete if unused. The repo is tied to a bug report filed by Mike Bostock, the creator of the D3 visualization library, on the Rollup GitHub page. To understand the problem, it helps to know that when you write JavaScript, you often import a lot of code you don't end up using. Modern build tools try to make your final file smaller by removing the unused parts, a process called "tree shaking." The sideEffects field in a project's configuration helps the build tool decide what it can safely remove without breaking the application. This test case demonstrates that Rollup is incorrectly deleting or altering code based on this flag, which can break a functioning application. A developer or project manager working on a JavaScript library, especially something visual like D3, would run into this issue when their build process unexpectedly breaks their code. By running a couple of simple commands, someone experiencing the bug can see the problem happen in real time. The project also includes a simple way to confirm the cause: if you remove the sideEffects declaration from the test package's configuration and run the test again, the problem goes away, proving that the flag is the culprit. The project itself is purely a diagnostic tool. It contains no features or application logic. Its sole purpose is to serve as a clear, reproducible example so the maintainers of Rollup can investigate and fix the underlying tree-shaking issue.
A minimal test case that reproduces a bug in the Rollup JavaScript build tool, showing how its handling of the sideEffects flag incorrectly deletes code during tree shaking and breaks working applications.
Mainly JavaScript. The stack also includes JavaScript, Rollup, Node.js.
Dormant — no commits in 2+ years (last push 2024-06-03).
No license information is provided in this repository.
Setup difficulty is rated easy, with roughly 5min to a first successful run.
Mainly developer.
This repo across BitVibe Labs
Verify against the repo before relying on details.