Custom bundling

I want to create custom bundle with modeler,mini map and properties panel. I used the sample for viewer custom bundler. but it’s not working.

here is the code :
import inherits from ‘inherits’;

import Modeler from ‘bpmn-js/lib/Modeler’;

import propertiesPanelModule from ‘bpmn-js-properties-panel’;
import bpmnPropertiesProviderModule from ‘bpmn-js-properties-panel/lib/provider/bpmn’;
import Minimap from ‘diagram-js-minimap/lib/’;

export default function CustomModeler(options) {
Modeler.call(this, options);
}

inherits(CustomModeler, Modeler);

CustomModeler.prototype._customModules = [
propertiesPanelModule,
bpmnPropertiesProviderModule,
Minimap
];

CustomModeler.prototype._modules = [].concat(
Modeler.prototype._modules,
CustomModeler.prototype._customModules
);

the building process is successful, but when I use the generated js file , I get this error
Uncaught TypeError: Cannot read properties of undefined (reading ‘depends’)

can anyone provide working example ?

Please share a running / prototypical example that clearly shows what you’re trying to achieve, what is working and what is not.

Use our existing starter projects to quickly hack it or share your existing, partial solution on GitHub or via a CodeSandbox. Provide the necessary pointers that allow us to quickly understand where you got stuck.

This way we may be able to help you in a constructive manner.

Thanks :heart:

I uploaded change project to github.just ignore readme file because it’s for original sample project

Thanks for sharing! Can you direct us to the point where the error is thrown?

Uncaught TypeError: Cannot read properties of undefined (reading ‘depends’)

Especially the stack trace would be interesting.

If you can download and build the example, It’s happening in custom.modeler.js that created.

After downloading, please run this commands:

Npm install
And then,
Npm run all

stack traces is :
Uncaught TypeError: Cannot read properties of undefined (reading ‘depends’)
at visit (custom-modeler.bundled.js:7478:9)
at Array.forEach ()
at visit (custom-modeler.bundled.js:7478:28)
at Array.forEach ()
at bootstrap (custom-modeler.bundled.js:7491:21)
at createInjector (custom-modeler.bundled.js:7529:11)
at CustomModeler.Diagram (custom-modeler.bundled.js:7585:43)
at CustomModeler.BaseViewer._init (custom-modeler.bundled.js:16439:12)
at CustomModeler.BaseViewer (custom-modeler.bundled.js:15856:9)
at CustomModeler.BaseModeler (custom-modeler.bundled.js:16583:15)

in this func:

  function visit(m) {
    if (hasModule(m)) {
      return;
    }

    (m.__depends__ || []).forEach(visit);

    if (hasModule(m)) {
      return;
    }

    addModule(m);

    (m.__init__ || []).forEach(function(c) {
      components.push(c);
    });
  }