mistralai / client-ts

TS Client library for Mistral AI platform
Apache License 2.0
30 stars 10 forks source link

Hi, I'm trying to deploy on nodejs production code and get error with mistral missing 'zod' #11

Open hiepxanh opened 3 months ago

hiepxanh commented 3 months ago

Start of losa-graphql container output (web.1) remote: node:internal/modules/cjs/loader:1212 remote: const err = new Error(message); remote: ^ remote: Error: Cannot find module 'zod' remote: Require stack: remote: - /batcave/node_modules/@mistralai/mistralai/lib/base64.js remote: - /batcave/node_modules/@mistralai/mistralai/lib/encodings.js remote: - /batcave/node_modules/@mistralai/mistralai/lib/sdks.js remote: - /batcave/node_modules/@mistralai/mistralai/sdk/sdk.js remote: at Module._resolveFilename (node:internal/modules/cjs/loader:1212:15) remote: at Module._load (node:internal/modules/cjs/loader:1038:27) remote: at wrapModuleLoad (node:internal/modules/cjs/loader:212:19) remote: at Module.require (node:internal/modules/cjs/loader:1297:12) remote: at require (node:internal/modules/helpers:123:16) remote: at Object. (/batcave/node_modules/@mistralai/mistralai/lib/base64.js:36:24) remote: at Module._compile (node:internal/modules/cjs/loader:1460:14) remote: at Module._extensions..js (node:internal/modules/cjs/loader:1544:10) remote: at Module.load (node:internal/modules/cjs/loader:1275:32) remote: at Module._load (node:internal/modules/cjs/loader:1091:12) { remote: code: 'MODULE_NOT_FOUND', remote: requireStack: [ remote: '/batcave/node_modules/@mistralai/mistralai/lib/base64.js', remote: '/batcave/node_modules/@mistralai/mistralai/lib/encodings.js', remote: '/batcave/node_modules/@mistralai/mistralai/lib/sdks.js', remote: '/batcave/node_modules/@mistralai/mistralai/sdk/sdk.js' remote: ] remote: } remote: Node.js v22.3.0 remote: node:internal/modules/cjs/loader:1212 remote: const err = new Error(message); remote: ^

lerela commented 3 months ago

Hi! Are you using yarn? If so, you should manually install zod. Let me know if that fixes the issue.

hiepxanh commented 3 months ago

No i have no issue on client using pnpm, but when deploy production with 'npm i --production' I get this issue, I do install zod as workaround but i think we can do something on package.json to configure it