Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

react example process undefined #73

Open
Altamimi-Dev opened this issue Sep 25, 2023 · 2 comments
Open

react example process undefined #73

Altamimi-Dev opened this issue Sep 25, 2023 · 2 comments

Comments

@Altamimi-Dev
Copy link

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?

@erikh2000
Copy link

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

@damian87x
Copy link

damian87x commented Mar 28, 2024

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); }) };

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants