-
Notifications
You must be signed in to change notification settings - Fork 33
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 when calling the BpmnVisualization constructor in a Angular 11 project #2221
Comments
Hi
Today, when using webpack, you must configure the mainFields AFAIK, this is required because bpmn-visualization defines a browser attribute in its package.json and the value relates to a file that cannot be used by webpack. By default, webpack first uses the "browser" attribute when doing dependency resolution. So, that's why we must override the webpack default configuration to make it uses the module bundle for instance. I plan to work on this topic in the next weeks. In the meantime, you will have to do custom webpack configuration. Notice that we have also planned (for a long time 😺) to test the angular integration. I will try to work on it if we are stuck. See process-analytics/bpmn-visualization-examples#20 Please let me know if this answer helps or if you need more information. |
Thanks for the feedback, it gives me some ideas for improvement. It's now clear that we need examples to test various Angular integrations. I will try to work on this topic next week. |
@13322211021 I have a question about
Can you please provide the error you have with a recent version of bpmn-visualization and tells me the version of Typescript you use when getting the error? |
@13322211021 I have worked on the topic and I have now a clearer vision of the situation
I have also worked on an example that integrates bpmn-visualization in an Angular 14 project and it works (as far as I use a version that fixes the "browser" field 😄). I don't plan to do tests with previous Angular versions: the issue with Angular 11 is only related to the TypeScript version required by bpmn-visualization. I will keep you posted when I have news. |
ℹ️ Here are the news 👀 The Angular 14 example is under review (process-analytics/bpmn-visualization-examples#411), and there is no integration problem with version We have found several ways to lower the minimum TS version, which should soon be TS 4.1 at the most or possibly a lower version. Discussions are ongoing on the subject (#2231 (comment)). Thanks for you patience |
Hi @13322211021, the issue is now fixed in the |
|
It's amazing that you can give me continuous feedback. Thanks for your fantastic work!👍👍 |
import { BpmnVisualization } from 'bpmn-visualization';
const bpmnVisualization = new BpmnVisualization({ container: 'bpmn-container' });
When execute this line will get this error:
TypeError: bpmn_visualization__WEBPACK_IMPORTED_MODULE_4__.BpmnVisualization is not a constructor
I have tried several versions, but got the same.
I use it in the angular 11.
The text was updated successfully, but these errors were encountered: