https://www.boundaryml.com logo
How can I use baml client in convex function runni...
# help
s
I am not able to deploy my convex function with baml client due the following error
Copy code
Loading the pushed modules encountered the following
    error:
Uncaught Failed to analyze workflows/agents.js: Cannot find native binding. npm has a bug related to optional dependencies (https://github.com/npm/cli/issues/4828). Please try `npm i` again after removing both package-lock.json and node_modules directory.
I get the following error after I clear node modules and lock file and try to deploy
Copy code
Loading the pushed modules encountered the following
    error:
Uncaught Failed to analyze workflows/agents.js: Cannot read properties of undefined (reading 'fromFiles')
    at <anonymous> (../../src/baml_client/globals.ts:30:4)
Is there a way to run baml client in these serverless environment?
v
hi @star3lord thanks for flagging this. are you using the .node loader in convex?
It similar to what one needs with nextjs
you may need to do:
Copy code
npm install --include=optional
https://chatgpt.com/share/68e417f9-0534-800d-b0bc-68f241e2d8f1
s
Im facing this exact issue and this hasnt made a difference. I've tried downgrading baml but still no luck.
b
@chrisbod4 I remember you were trying to use Baml with a
use node
loader - what came of that?
a
we would need to support WASM
but we unfortunately don't support it yet