4

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"
        }
      }
    ]
  ]
}
Arthur Robaeys
  • 327
  • 3
  • 15

1 Answers1

15

I found my fix:

{
  "presets": [
    [
      "@babel/preset-env",
      {
        "targets": {
          "node": "10"
        }
      }
    ],
    "@babel/preset-react"
  ]
}
Arthur Robaeys
  • 327
  • 3
  • 15
  • If you followed this tutorial (https://medium.com/@danlegion/react-server-side-rendering-with-express-b6faf56ce22) it says vaguely where it should go but, I thank you for helping me I was stuck here too Thanks – VericalId Sep 27 '20 at 20:26
  • The heck; anyone know why the order matters here? – Warren Spencer Mar 06 '21 at 03:49
  • never mind; it's how you wrap the parameters in the sub array https://babeljs.io/docs/en/presets#preset-options – Warren Spencer Mar 06 '21 at 03:56