react-speech-recognition icon indicating copy to clipboard operation
react-speech-recognition copied to clipboard

regeneratorRuntime is not defined

Open tiavina-mika opened this issue 1 year ago • 9 comments

Hello.

I get this error: regeneratorRuntime is not defined

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

tiavina-mika avatar Nov 05 '23 05:11 tiavina-mika

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

SHaiderX avatar Nov 07 '23 04:11 SHaiderX

SHaiderX

thanks bro!

JunRod avatar Dec 13 '23 17:12 JunRod

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

ManishaSwain8 avatar Feb 04 '24 21:02 ManishaSwain8

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

josh3io avatar Mar 14 '24 01:03 josh3io

You should share your code @josh3io and @vipulghadi

ManishaSwain8 avatar Mar 14 '24 03:03 ManishaSwain8

i am facing same problem

vipulghadi avatar Mar 17 '24 13:03 vipulghadi

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

"use client"
import 'regenerator-runtime/runtime';
import SpeechRecognition, { useSpeechRecognition } from 'react-speech-recognition';

hinn254 avatar Apr 14 '24 08:04 hinn254