Vue3 error with BpmnModeler

Hello everyone! I’m having a problem with a project made in Vue 3, and bpmn-js 16.4.0. When compiling it for production, I get this error:
Captura de pantalla 2024-03-12 a la(s) 12.10.55

The portion of code where it crashes is here:

 eventsListener() {
      const eventBus = this.bpmnModeler.get("eventBus");
      eventBus.on(["commandStack.changed"], async (event) => {
        let lastChange;
//here is the error
        this.bpmnModeler.invoke(function (commandStack) {
          lastChange = commandStack._stack[commandStack._stack.length - 1]

//more code

I believe that it must be due to a minification issue that occurs in the compilation. How can I solve it?