JamesBrill / react-speech-recognition

💬Speech recognition for your React app
https://webspeechrecognition.com/
MIT License
637 stars 116 forks source link

regeneratorRuntime is not defined #196

Open tiavina-mika opened 8 months ago

tiavina-mika commented 8 months ago

Hello.

I get this error: regeneratorRuntimeis not defined

Here is the code: https://codesandbox.io/s/github/tiavina-mika/react-speech-recognition-issue

SHaiderX commented 8 months ago

do: npm i regenerator-runtime then import 'regenerator-runtime/runtime'; above the react-speech-recognition import

JunRod commented 6 months ago

SHaiderX

thanks bro!

ManishaSwain8 commented 5 months ago

If you are using React make sure to add this [ import "regenerator-runtime/runtime"; ] at line 1 of " main.jsx" file OR If using Javascript add the above import statement at line 1 of " index.js" file OR If using Typescript add the above import statement at line 1 of " index.tsx" file

josh3io commented 3 months ago

solution is not working for me using app router and putting the import in my root component

ManishaSwain8 commented 3 months ago

You should share your code @josh3io and @vipulghadi

vipulghadi commented 3 months ago

i am facing same problem

hinn254 commented 2 months ago

@vipulghadi import it just above where you import react-speech-recognition

"use client"
import 'regenerator-runtime/runtime';
import SpeechRecognition, { useSpeechRecognition } from 'react-speech-recognition';
ndroo commented 1 month ago

@hinn254 's remark here was very helpful. I added the import, and my component is consumed by a client side component, but adding "use client" and the import for the regenerator-runtime in the Dictaphone component directly resolved it for me.

hinn254 commented 1 month ago

@hinn254 's remark here was very helpful. I added the import, and my component is consumed by a client side component, but adding "use client" and the import for the regenerator-runtime in the Dictaphone component directly resolved it for me.

glad it helped