DEV Community

Discussion on: Migrating Next.js plugins from next-compose-plugins

Collapse
 
miguelacleite profile image
Miguel Leite • Edited

You need to be careful about the final reduce, since you're passing the silent property to every single plugin. You're also missing a closing parenthesis on the next() call.

return plugins.reduce((acc, next) => {
  if (next.name === 'withSentryConfig') {
    return next(acc, {silent: true });
  }

  return next(acc);
}, {
  // the rest of next.js config
});
Enter fullscreen mode Exit fullscreen mode

How about this? 👆