Open czwlkjgzs opened 2 months ago
I've solved this problem.
My vite
version is 5.x, So I have to use --force
parameter
npm install vite-plugin-node-stdlib-browser --force
if the suffix of the vite config file is .ts
, you need to change .ts
to .js
.
Then configure as follows.
import nodeStdlibBrowser from 'vite-plugin-node-stdlib-browser';
export default defineConfig({
plugins: [
...
nodePolyfills({protocolImports: true}),
nodeStdlibBrowser(),
...
],
})
There is still a problem here.
When I try vite build
. Everything is ok.
But when I try vite
. I have to comment out nodePolyfills({protocolImports: true}),
I've already use
import ollama from ollama/browser
. But the error occured when I tryvite build
.this is my
vite.config.js