简体   繁体   中英

build failed due to babelrc, presets[0] [1] must be an object, false or undefined

I'm having issues with babel. I'm trying to use async/await in my application, and for that I needed to add the node option in babelrc. However, I'm getting this error:

I checked this question, but I'm a fair rookie and I don't really see where my problem lies. Plugins[0][1] must be an object, false, or undefined

My babelrc file:

{
  "presets": [
    [
      "@babel/preset-env",
      "@babel/preset-react",
      {
        "targets": {
          "node": "10"
        }
      }
    ]
  ]
}

I found my fix:

{
  "presets": [
    [
      "@babel/preset-env",
      {
        "targets": {
          "node": "10"
        }
      }
    ],
    "@babel/preset-react"
  ]
}

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