Context
After #559 resolves the experimental React graph and #560 produces a valid reusable text lockfile, unchanged bake/dev/request-cookies.test.ts starts its Bake dev servers and reaches module resolution. Both cases then panic in the native resolver before request-cookie semantics execute.
Pinned Bun source: 4982b91e3702094330f3be3883354c52b8c01323.
Exact failure
thread panic: attempt to use null value
packages/runtime/src/resolver/resolver.zig:1408
const pkg = import_dir_info.package_json.?;Call path: checkRelativePath → resolveWithoutSymlinks → resolveAndAutoInstall → resolveWithFramework → Bake BundleV2.resolveImportRecords.
The server closes the socket, so both unchanged cases fail with ECONNRESET: 0 passed, 2 failed.
Acceptance criteria
- Port Bun's package-json invariant or handle a missing
package_jsonwithout a panic incheckRelativePath. - Add focused resolver coverage for the import-directory state that reproduces the null package metadata.
- Preserve existing resolver and bundler behavior.
- Rerun unchanged
request-cookies.test.tsto reach cookie semantics or its next independent boundary. - Keep #555 and #66 updated with exact results.