Open Altamimi-Dev opened 1 year ago
Just making a quick guess from vague memories of handling the same/similar issue...
I think maybe it's something related to a newer version of WebPack causing process
to be undefined. I forget the exact cause - see https://stackoverflow.com/questions/70368760/react-uncaught-referenceerror-process-is-not-defined
You might double-check that you're building the unmodified example. E.g., no updates to package.json.
When I wrote my own web app that uses vosk-browser
, I wrote a different Microphone class that doesn't have the same dependencies. This allowed me to use the newer version of create-react-app/WebPack.
-Erik
I tried using webpack and Vite and no success with adding polyfill
Added temp solution. If anyone finds a better way, please share
window.process = { ...window.process, nextTick: (callback, ...args) => new Promise((resolve) => { setTimeout(() => { callback(...args); resolve(null); }, 0); }) };
when trying to run the react example i get an error from the _stream_readable process undefined .
function maybeReadMore(stream, state) { if (!state.readingMore) { state.readingMore = true; process.nextTick(maybeReadMore_, stream, state); } }
how can i fix this?