Summary
Any TypeScript program that imports and uses @perryts/mysql crashes immediately at the first DB query when run via perry run (and the equivalent perry compile-d binary). The same crash reproduces on @perryts/mysql's own examples/perry-aot-minimal.ts inside that project. So this looks like a Perry runtime issue with how @perryts/mysql boxes JS values, even though the driver advertises Perry support.
Identical code runs cleanly under Node + tsx — the bug is Perry-runtime-specific.
Reproducer
// repro.ts
import { Pool } from "@perryts/mysql";
async function main() {
const pool = new Pool({ url: "mysql://root:@127.0.0.1:3306/test" });
const rows = await pool.query("SELECT 1 AS n");
console.log(rows);
await pool.end();
}
main().catch((err) => {
console.error(err);
process.exit(1);
});
# under tsx — works
$ npx tsx repro.ts
[ { n: 1 } ]
# under perry run — crashes
$ perry run repro.ts
[PERRY WARN] js_box_get: invalid box pointer 0x0 #0
TypeError: (number).next is not a function
perry compile repro.ts -o repro && ./repro produces the same stderr.
@perryts/mysql's own bundled example (examples/perry-aot-minimal.ts) reproduces the crash too, ruling out anything app-specific.
Impact
Production deploy of our server (which uses @perryts/mysql for MySQL access) is blocked on this — we can't ship the perry compile-d native binary. Today we run tsx server/main.ts in production-equivalent settings as a workaround. 24 e2e suites cover the server end-to-end via tsx; switching the e2e to run the Perry binary is the test we'd add the moment this lands.
Possible split
If this turns out to be a @perryts/mysql issue rather than core Perry, happy to refile on PerryTS/mysql — let me know.
Environment
perry 0.5.503
@perryts/mysql 0.1.1 (current main)
- macOS 25.4.0 (Darwin), arm64
- MySQL 9.6 (also reproduced against MySQL 8.0)
Summary
Any TypeScript program that imports and uses
@perryts/mysqlcrashes immediately at the first DB query when run viaperry run(and the equivalentperry compile-d binary). The same crash reproduces on@perryts/mysql's ownexamples/perry-aot-minimal.tsinside that project. So this looks like a Perry runtime issue with how@perryts/mysqlboxes JS values, even though the driver advertises Perry support.Identical code runs cleanly under Node + tsx — the bug is Perry-runtime-specific.
Reproducer
perry compile repro.ts -o repro && ./reproproduces the same stderr.@perryts/mysql's own bundled example (examples/perry-aot-minimal.ts) reproduces the crash too, ruling out anything app-specific.Impact
Production deploy of our server (which uses
@perryts/mysqlfor MySQL access) is blocked on this — we can't ship theperry compile-d native binary. Today we runtsx server/main.tsin production-equivalent settings as a workaround. 24 e2e suites cover the server end-to-end via tsx; switching the e2e to run the Perry binary is the test we'd add the moment this lands.Possible split
If this turns out to be a
@perryts/mysqlissue rather than core Perry, happy to refile onPerryTS/mysql— let me know.Environment
perry 0.5.503@perryts/mysql 0.1.1(current main)