https://www.boundaryml.com logo
I've found an issue that's ESM-related:
# contributing
l
I've found an issue that's ESM-related: https://github.com/BoundaryML/baml/issues/2298 Opened a PR with what I've done in my own repo to fix this: https://github.com/BoundaryML/baml/pull/2299
a
thanks so much! I'll release this today. I think what we need is to setup a mini example project that can repros this. I'll see if i can set up a node 22 test today. The patch should be released today. What slightly worries me is the type resolution for TS
l
Yeah it's a good one to check on
I haven't had time to look at the docs
Copy code
// package.json
{
    "name": "my-package",
    "type": "module",
    "exports": {
        ".": {
            // Entry-point for `import "my-package"` in ESM
            "import": {
                // Where TypeScript will look.
                "types": "./types/esm/index.d.ts",

                // Where Node.js will look.
                "default": "./esm/index.js"
            },
            // Entry-point for `require("my-package") in CJS
            "require": {
                // Where TypeScript will look.
                "types": "./types/commonjs/index.d.cts",

                // Where Node.js will look.
                "default": "./commonjs/index.cjs"
            },
        }
    },

    // Fall-back for older versions of TypeScript
    "types": "./types/index.d.ts",

    // CJS fall-back for older versions of Node.js
    "main": "./commonjs/index.cjs"
}
It does seem to be a thing