mirror of
https://github.com/oven-sh/bun
synced 2026-02-15 05:12:29 +00:00
…int.generate() `ServerEntryPoint.source` defaults to `undefined`, and accessing its `.contents` or `.path.text` fields before `generate()` has been called causes a segfault. This happens when `bun:main` is resolved in contexts where `entry_point.generate()` is skipped (HTML entry points) or never called (test runner). Add a `generated` flag to `ServerEntryPoint` and guard both access sites: - `getHardcodedModule()` in ModuleLoader.zig (returns null instead of crashing) - `_resolve()` in VirtualMachine.zig (falls through to normal resolution) ### What does this PR do? ### How did you verify your code works? Co-authored-by: Claude Bot <claude-bot@bun.sh> Co-authored-by: Claude <noreply@anthropic.com>