Perry: origin/main @ a1d9ce6 (v0.5.1174) · macOS arm64
Setup: next in perry.compilePackages + perry.allow.compilePackages: ["*"]; default (auto-optimize) build.
Bug
next/server's NextResponse.json(...) segfaults (SIGSEGV / exit 139). Narrowing:
import { NextResponse } from 'next/server'; console.log(typeof NextResponse) → prints function, exit 0 ✅ (import + symbol resolution work)
NextResponse.json({ ... }, { status }) → SIGSEGV before any further use (no .text()/.status needed)
NextResponse extends the web Response; the crash is in constructing the JSON response.
Repro
import { NextResponse } from 'next/server';
const res = NextResponse.json({ ok: true, n: 42 }, { status: 201 });
console.log("created", res.status);
Expected
A Response with status === 201 (no Node strip-types baseline — next/server needs a bundler to run under Node; expected per the web/Next API).
Actual (Perry)
(no output; SIGSEGV / exit 139)
Two non-fatal warnings also emit during compile (likely related coverage gaps): Could not resolve import 'next/dist/compiled/ua-parser-js' from user-agent.js.
Perry:
origin/main@ a1d9ce6 (v0.5.1174) · macOS arm64Setup:
nextinperry.compilePackages+perry.allow.compilePackages: ["*"]; default (auto-optimize) build.Bug
next/server'sNextResponse.json(...)segfaults (SIGSEGV / exit 139). Narrowing:import { NextResponse } from 'next/server'; console.log(typeof NextResponse)→ printsfunction, exit 0 ✅ (import + symbol resolution work)NextResponse.json({ ... }, { status })→ SIGSEGV before any further use (no.text()/.statusneeded)NextResponseextends the webResponse; the crash is in constructing the JSON response.Repro
Expected
A
Responsewithstatus === 201(no Node strip-types baseline —next/serverneeds a bundler to run under Node; expected per the web/Next API).Actual (Perry)
Two non-fatal warnings also emit during compile (likely related coverage gaps):
Could not resolve import 'next/dist/compiled/ua-parser-js' from user-agent.js.