Netlify CLI crashes on application error

I have noticed that the netlify CLI on netlify dev has started crashing when there are errors in the code that previously did not crash the CLI.
The error is the following

 Error: Netlify CLI has terminated unexpectedly
This is a problem with the Netlify CLI, not with your application.
If you recently updated the CLI, consider reverting to an older version by running:

npm install -g netlify-cli@VERSION

You can use any version from https://ntl.fyi/cli-versions.

Please report this problem at https://ntl.fyi/cli-error including the error details below.

The errors have occured with

  • Database request erros
  • import errors
  • type errors

This is a known change, instead of showing a useless chunk of error, it now shows a nicely formatted error message. This was done here: Release v16.4.0 ยท netlify/cli (github.com)

What is the reason it is happening. We would like the the cli to keep running if errors occur.

Depending on the error, the CLI might or might not be able to continue. You should address the cause of the error than trying to keep the CLI running.