ollama-js icon indicating copy to clipboard operation
ollama-js copied to clipboard

Compatibility with react native projects

Open VariabileAleatoria opened this issue 1 year ago • 1 comments

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?

VariabileAleatoria avatar Dec 18 '24 10:12 VariabileAleatoria

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 :)

BhavinPatel04 avatar Dec 21 '24 19:12 BhavinPatel04