ollama / ollama-js

Ollama JavaScript library
https://ollama.ai
MIT License
1.56k stars 103 forks source link

'promises' is not exported by __vite-browser-external #76

Closed makeryangcom closed 2 months ago

makeryangcom commented 2 months ago
../../release/dist/preload/browser.cjs   0.14 KiB / gzip: 0.12 KiB
vite v3.2.8 building for production...
✓ 2006 modules transformed.
'promises' is not exported by __vite-browser-external, imported by node_modules/ollama/dist/index.mjs
file: D:/ChatDesktop/node_modules/ollama/dist/index.mjs:2:13
1: import { O as Ollama$1, h as head, p as post } from './shared/ollama.be8fd0da.mjs';
2: import fs, { promises, createReadStream } from 'fs';
                ^
3: import { resolve, join, dirname } from 'path';
4: import { createHash } from 'crypto';
m0o0scar commented 2 months ago

@makeryangcom could you please explain your issue with some more detail? how you encoutered this error? what're the steps to reproduce?

makeryangcom commented 2 months ago

I have solved this problem; it can be avoided by not using the browser.

tang2087 commented 1 week ago

You can use polyfills for browser: https://kontext.tech/article/1375/resolve-promises-is-not-exported-by-vite-browser-external