cloudflare / cloudflare/vinext

Rolldown segfault when bundling react-simple-maps v3.0.0

Open
#799 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
8.8k
Forks
406
Avg merge
2d 6h
Merged PRs (30d)
120

Description

## Description

`vinext build` segfaults (SIGSEGV, exit 139) during step 4/5 (client environment build) when `react-simple-maps` v3.0.0 is in the dependency graph. The crash occurs in Rolldown's native chunk rendering phase after all modules are successfully transformed.

## Environment

- vinext 0.0.40, Vite 8.0.7, Rolldown 1.0.0-rc.13
- Node.js v25.3.0, Linux x86_64, 62GB RAM
- Next.js 16.2.2, App Router

## Reproduction

1. Any Next.js App Router project with `react-simple-maps` v3.0.0 as a dependency
2. Configure vinext with Cloudflare + Tailwind plugins
3. `npx vinext build` → segfault at step 4/5

Minimal trigger:
```tsx
import { ComposableMap } from "react-simple-maps";
```

## Root cause isolation

Binary search through dependencies:

| Test | Result | Client Modules |
|------|--------|---------------|
| Minimal app (no deps) | Builds | 33 |
| + shadcn/ui components | Builds | 2097 |
| + recharts | Builds | 2676 |
| + d3-geo alone | Builds | 3271 |
| + d3-zoom + d3-selection alone | Builds | 3329 |
| + `react-simple-maps` ComposableMap import | **CRASHES** | 3461 |
| + react-simple-maps externalized | Builds | 3153 |
| Full app with externalized react-simple-maps | Builds | 3355 |

All D3 sub-dependencies (`d3-geo`, `d3-zoom`, `d3-selection`, `topojson-client`) work individually. The crash only occurs when Rolldown processes `react-simple-maps`' own ESM bundle (`dist/index.es.js`, 1053 lines) which re-exports and combines these dependencies.

## Workaround

```ts
export default defineConfig({
build: {
rollupOptions: {
external: ["react-simple-maps"],
},
},
});
```

## Notes

- No JS stack trace or Rust backtrace produced (`RUST_BACKTRACE=full` has no output)
- Not a memory issue (62GB RAM, `--max-old-space-size=8192` doesn't help)
- Likely a specific code pattern in react-simple-maps' ESM bundle that triggers a Rolldown bug

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.