-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
getting err @mistralai/mistralai v 0.1.3 doesn't support require way of importing library. i want to know the version of library which support it. #59
Comments
Reproductible error here. |
what do you mean by dynamic import? |
Also seeing this issue. Any resolution in the pipeline please? |
Seeing the same in an Electron app using vite. |
Also seeing this issue when importing in typescript: import MistralClient from '@mistralai/mistralai';
const apiKey = process.env.MISTRAL_API_KEY;
const client = new MistralClient(apiKey); |
same issue. any luck on why/fix? |
Same issue |
We have identical error when trying to import in a typescript project. Any workaround? |
For now I just copied index.js in my project renamed it and imported it. Works for me. |
@Devmindtk , you can find in this blogpost Mistral gagnant. Mistral AI and SAP Kyma serverless.) a fully working solution of combining mistralai into a CJS module. PS. Full recipe: mistral gagnant |
@nico-crest , please refer to my previous comment |
What index.js are you talking about? Can you provide more guidance? |
@ptesny I know, I went through it but I don't see how to implement it with nestjs as I don't really understand it to be honest :) In the end I went the old fashion way and call their API directly using axios |
|
Error [ERR_REQUIRE_ESM]: require() of ES Module node_modules@mistralai\mistralai\src\client.js not supported. Instead change the require of client.js to a dynamic import() which is available in all CommonJS modules.
The text was updated successfully, but these errors were encountered: