I have this error when I try to compile my app. The error comes from `babel-plugin-proposal-object-rest-spread` here <https://github.com/babel/babel/blob/6e551ae8827d064680c1344074db9fb3093967e9/packages/babel-plugin-proposal-object-rest-spread/src/index.js#L22> :

> 
> Trace: error TypeError: api.targets is not a function
> | at /home/username/Documents/front-newlook/node\_modules/next/node\_modules/@babel/preset-env/node\_modules/@babel/plugin-proposal-object-rest-spread/lib/index.js:38:25
> | at /home/username/Documents/front-newlook/node\_modules/next/node\_modules/@babel/preset-env/node\_modules/@babel/helper-plugin-utils/lib/index.js:19:12
> | at /home/username/Documents/front-newlook/node\_modules/next/node\_modules/@babel/core/lib/config/full.js:166:14
> | at cachedFunction (/home/username/Documents/front-newlook/node\_modules/next/node\_modules/@babel/core/lib/config/caching.js:32:19)
> | at loadPluginDescriptor (/home/username/Documents/front-newlook/node\_modules/next/node\_modules/@babel/core/lib/config/full.js:201:28)
> | at /home/username/Documents/front-newlook/node\_modules/next/node\_modules/@babel/core/lib/config/full.js:71:20
> 
> 
> 

My `babel.config.json` is like this:

```
{
  "plugins": [
    "emotion",
    "macros",
    "@babel/plugin-proposal-class-properties"
  ],
  "presets": ["next/babel"],
  "env": {
    "test": {
      "plugins": ["require-context-hook"]
    }
  }
}

```

Does anyone has an idea? Thank you