Dmn-js 1.1.1 usage


I try to upgrade from dmn-js ^0.11.0 to 1.1.1 but when I try to grunt my project it throws the following error when working on grunt-browserify task:

import EditingManager from ‘dmn-js-shared/lib/base/EditingManager’;
ParseError: ‘import’ and ‘export’ may appear only with ‘sourceType: module’

I saw in the dmn-js code base that it migrated to ES2015 and so I tried to use babelify transformator to deal with ES2015 code but without success.

Is there any working example how to use new dmn-js 1.1.1 package with grunt and grunt-browserify?

Thank you for your help in advance.
Rómeó Nagy


how did you add the babel transform?

We’re using the new dmn-js in the Camunda Modeler.



“babelify”: “7.3.0”,
“babel-preset-env”: “1.6.1”,


browserify: {
     modeler: {
    	options: {
    	      browserifyOptions: {
    			insertGlobalVars: {
    			process: function() {
    		    	    return 'undefined';
    			Buffer: function() {
    			     return 'undefined';
    	  transform: [['babelify', {presets: ['env']}]]
        files: {
             '<%= config.dist %>/bundle.js': ['<%= config.sources %>/modeler/index.js']


Finally grunt build procedure is working but still cannot use Editor or Viewer module.
Should I require the following modules to create new Editor or Viewer?

var DmnEditor = require(‘dmn-js-decision-table/lib/Editor’);
var DmnViewer = require(‘dmn-js-decision-table/lib/Viewer’);
var DrdModeler = require(‘dmn-js-drd/lib/Modeler’);
var DrdViewer = require(‘dmn-js-drd/lib/NavigatedViewer’);

and instantiate as e.g.: ?

new DmnModeler({
container: '#dmnPanel

Can you write a small example or update or create a new dmn-js example which using the new 1.1.1 version of dmn-js?

Thank you.

Thanks for your urgent interest in dmn-js@1.x. We’ll create examples as well as migration guides from dmn-js@0.x to dmn-js@1 as soon as we reached feature parity and stability on the 1.x branch.

Please bear with us until we get these things done. :slightly_smiling_face: