简体   繁体   中英

React Error when using react-speech-recognition “ReferenceError: regeneratorRuntime is not defined”

I'm getting error when trying to implement react-speech-recognition in my react project. 在此处输入图像描述

and here is my package.json file

{
  "name": "smart-mirror",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@babel/runtime": "^7.13.10",
    "@material-ui/core": "^4.11.3",
    "@material-ui/icons": "^4.11.2",
    "axios": "^0.21.1",
    "firebase": "^8.3.1",
    "firebase-admin": "^9.5.0",
    "install": "^0.13.0",
    "npm": "^7.7.5",
    "react": "^17.0.2",
    "react-dom": "^17.0.2",
    "react-icons": "^4.2.0",
    "react-modal": "^3.12.1",
    "react-scripts": "1.1.5",
    "react-speech-recognition": "^3.7.0",
    "react-spring": "^9.0.0-rc.3",
    "styled-components": "^5.2.1"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test --env=jsdom",
    "eject": "react-scripts eject"
  },
  "devDependencies": {
    "@babel/plugin-transform-runtime": "^7.13.10",
    "@babel/core": "^7.8.7",
    "babel-loader": "^8.2.2",
    "babel-polyfill": "^6.26.0",
    "babel-preset-es2015": "^6.24.1",
    "babel-preset-stage-0": "^6.24.1"
  }
}

After doing some research I found its the babel version. So I installed newer version. But still I'm getting the same error

try downgrade react version to v16.0.2

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM