Gatsby build fails in @netlify/plugin-gatsby (onBuild event)

Another Gatsby Cloud refugee trying to migrate a site to Netlify.

The site builds locally using gatsby build, but fails locally and when deploying to Netlify at the very last step.

Build logs attached, but the two errors thrown at the end are:

TypeError: object is not iterable (cannot read property Symbol(Symbol.iterator))
    at Object.filter (file:///Users/REDACTED/.nvm/versions/node/v18.18.0/lib/node_modules/netlify-cli/node_modules/@netlify/build/lib/plugins/ipc.js:32:70)
    at ChildProcess.onItem (file:///Users/REDACTED/.nvm/versions/node/v18.18.0/lib/node_modules/netlify-cli/node_modules/p-event/index.js:41:35)
    at ChildProcess.emit (node:events:529:35)
    at ChildProcess.emit (node:domain:489:12)
    at emit (node:internal/child_process:944:14)
    at process.processTicksAndRejections (node:internal/process/task_queues:83:21)

We’ve seen this issue with 1 other user, so far we’ve not had a chance to investigate it deeply and there’s no solution or workaround that we’re aware of. Mind sharing a minimal reproduction?

We managed to isolate this issue to only happening when the gatsby-plugin-algolia plugin was enabled. After refactoring our configuration for gatsby-plugin-algolia in gatsby-config.js, we stopped getting the error.