Found the solution
When using Camunda 7 (aka platform) related modules, use this
import BpmnModeler from "camunda-bpmn-js/lib/camunda-platform/Modeler";
When using Camunda 8 (aka cloud) related modules, use this
import BpmnModeler from "camunda-bpmn-js/lib/camunda-cloud/Modeler";
For the above code, switching to the latter avoids the error.
PS: If I may gush a bit, this is a wonderful library. It feels like a master class on how to provide high levels of functionality and extensibility. Thanks for making it available in the open source!