Issue with Next.js Production Build and bpmn-js Packages
Unanswered
Kintamani posted this in #help-forum
KintamaniOP
Hello everyone,
I'm currently working on a product using Next.js version 13.4.8, and I'm utilizing the bpmn-js package (https://github.com/bpmn-io/bpmn-js) alongside an extension for modelling processes and their properties (https://github.com/bpmn-io/bpmn-js-properties-panel).
While everything works smoothly in development mode (using npm run dev), I'm encountering an issue when running the application with the production build (npm run build). The app fails with a client-side error due to a syntax error in the compiled webpack chunk.
After some investigation, I've narrowed down the problem to the BPMN additional modules. In order to add more functionality to the modeler the following snipped is used:
As soon as I provide any additional modules the build still works fine but the site crashes with a client-side error. If I exclude them , everything works as expected even in production.
I suspect that the error may be occurring during the build process, resulting in a syntax error in the produced chunk (as shown in the attached image).
I've also posted this issue in the bpmn-js forum, but so far I haven't been able to find a solution. I'm reaching out here in the hopes that someone might have encountered a similar issue or have insights into how to resolve it.
Any help or suggestions would be greatly appreciated. Thank you in advance!
I'm currently working on a product using Next.js version 13.4.8, and I'm utilizing the bpmn-js package (https://github.com/bpmn-io/bpmn-js) alongside an extension for modelling processes and their properties (https://github.com/bpmn-io/bpmn-js-properties-panel).
While everything works smoothly in development mode (using npm run dev), I'm encountering an issue when running the application with the production build (npm run build). The app fails with a client-side error due to a syntax error in the compiled webpack chunk.
After some investigation, I've narrowed down the problem to the BPMN additional modules. In order to add more functionality to the modeler the following snipped is used:
import BpmnModeler from 'bpmn-js/lib/Modeler';
import {
BpmnPropertiesPanelModule,
BpmnPropertiesProviderModule,
} from 'bpmn-js-properties-panel';
const modeler = new BpmnModeler({
container: '#canvas',
propertiesPanel: {
parent: '#properties'
},
additionalModules: [
BpmnPropertiesPanelModule,
BpmnPropertiesProviderModule
]
});As soon as I provide any additional modules the build still works fine but the site crashes with a client-side error. If I exclude them , everything works as expected even in production.
I suspect that the error may be occurring during the build process, resulting in a syntax error in the produced chunk (as shown in the attached image).
I've also posted this issue in the bpmn-js forum, but so far I haven't been able to find a solution. I'm reaching out here in the hopes that someone might have encountered a similar issue or have insights into how to resolve it.
Any help or suggestions would be greatly appreciated. Thank you in advance!