type t
@module("@fastify/cors") external cors: t => Promise.t<unit> = "default"
@send external register: (t, t => Promise.t<unit>) => unit = "register"
code:
let server = Fastify.make()
Fastify.register(server, Fastify.cors)
.bs.js
import Fastify from "fastify";
import Cors from "@fastify/cors";
var server = Fastify();
server.register(function (prim) {
return Cors(prim);
});
This causes errors like
TypeError: Cannot read properties of undefined (reading 'delegator')
If I edit the bs.js file and remove that weird combinator it no longer errors. I haven’t figured it out yet but it might have something to do with reflection using argument counts.