ollama-js
ollama-js copied to clipboard
Compatibility with react native projects
While attempting to use this module in a React Native environment, I encountered the following error:
The package at "node_modules/ollama/dist/index.cjs" attempted to import the Node standard library module "fs". This failed because the React Native runtime does not include the Node standard library.
Is there any chance this library will become compatible with React Native in the future?
You need to use
import ollama from 'ollama/dist/browser';
in react-native.
Although, there is another blocker once you solve this. I've created an issue here and provided a workaround if you are interested :)