Update mermaidr if you do not have the latest version. Once the update is done, you must restart R.

update_mermaidr()