I did come across the Cross-Origin error when I was using:
xhr.open(‘GET’, ‘https://demo.bpmn.io/bpmn/diagrams/pizza-collaboration.bpmn’, true);
and looked in to CORS for the same.
But I also tried saving the bpmn(used different bpmns as well) locally and tested it with:
viewer.importXML("diagram.bpmn", function(err) { if (!err) { viewer.get('canvas').zoom('fit-viewport'); } else { console.log('something went wrong:', err); } });
Also tried:
viewer.importXML("./diagram.bpmn", function(err) {...} // note the ./
With the same error, but without the Cross-Origin error.