-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeError: this._createModdle is not a function error in production mode #6
Comments
TypeError: this._createModdle is not a function
error in production mode
I'm not an expert in Angular and their setup. As far as I can tell the TerserPlugin (for minification) seems to do interesting things with the BPMN viewer, breaking the bundle down the line. To workaround this, include our pre-packed distribution: import BpmnJS from 'bpmn-js/dist/bpmn-navigated-viewer.production.min.js'; |
Steps to reproduce for future reference:
Then open |
Reported in forum, too. |
Any idea for this issue??? |
We are open for your suggestions. |
This comment has been minimized.
This comment has been minimized.
Hi guys! Please take a look on this narve/angular-bpmn#15 |
This one worked for me! |
Applied the work around in 4e1f515. Thanks for the heads up. |
For what it's worth, I can confirm there is an issue with bpmn-js and/or one of its dependencies with TerserPlugin for webpack. I tried directly importing the production.min.js file but that didn't work. I am using React. I was able to exclude bpmn.io from being minified and it worked in a production build:
|
Could you provide a minimal test case that shows how this is related to the terser plug-in, not angular specific optimizations? |
It's look like issue in the side effect flag. Has anyone found solution? |
Hey, thanks for the example.
If I run everything in development mode / via
ng serve
it will work fine.But if I run it in production mode I'll get the following stack error:
The error is thrown when the viewer gets init via
private viewer: BpmnJS = new BpmnJS();
(Line 3 in stacktrace)compiled code:
I'm using a slight modificated version.
with
<div id="canvas" #ref ></div>
I'll try to init the viewer later. But the deployment takes around 12hours.
I'll also try to get the source mapper in production mode, but do you had the same error once?
Edit:
it is this line which throws the error: https://github.com/bpmn-io/bpmn-js/blob/ce964e4182559237bea0594556239de0e4884a0d/lib/Viewer.js#L120
The text was updated successfully, but these errors were encountered: