Using bpmn-js v2.4.0 width react

Embedding the modeler into my local application,after the bpmn-js installed,when i import Modeler from ‘bpmn-js/lib/Modeler’ ,it throw a error whitch in ./~bpmn-js@2.4.0bpmn-js/lib/Modeler.js. Module build failed:Error:parse Error:Line 1 :Illegal import declaration.

But i see the source code of bpmn-js package ,the declaration about import is no problem.

Can you tell me how to solve this problem?

Thanks a lot !

This is an issue with your setup. Could you share it with us?

As mentioned on the project main page you need an ES module aware transpiler to consume the library.

1 Like

I want to integrate bpmn-js into my project. Using the webpack to handle the js file in my project.but i try to use bpmn-js in my project ,it throw error.i don’t know how to resolve the error .

How can I solve the problem like me?

Share your project setup and there is a small chance we may be able to help you.

For what it’s worth, bpmn-js can be consumed absolutely fine within a standard react application, bootstrapped via the create-react-app helper:

Generate project boilerplate via:

npx create-react-app my-app
cd my-app
npm install bpmn-js

Edit src/App.js:

import Modeler from 'bpmn-js/lib/Modeler';

Run the application via:

npm start

12364758910

Those are all my setup,because we are in the company’s internal network development, so i can only take pictures to show you.

thank you

Please verify you’re using a compatible module bundler (cf. this issue).