perikost
12/11/2025, 2:12 PMfn Foo(options: ConfigOptions) -> Bar
the generated TypeScript client creates a function like:
async Foo(options: ConfigOptions, __baml_options__?) {
const options = { ...this.bamlOptions, ...(__baml_options__ || {}) };
...
this.runtime.callFunction("Foo", { options });
}
Because the parameter options and the internal variable const options use the same name, the parameter gets shadowed and the runtime receives the wrong value resulting in [BAML ERROR]: Invalid parameters for BAML function Foo
It seems like other parameter names could also clash with internal locals (e.g. signal, collector, env, raw, etc.).
Should I open a GitHub issue for this (didn't find anything similar)?Vaibhav (BAML 🐑)
12/11/2025, 2:47 PMVaibhav (BAML 🐑)
12/11/2025, 2:47 PMVaibhav (BAML 🐑)
12/11/2025, 2:48 PM