You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
The current value of the browser field in the package.json is set to the IIFE bundle file and it is a wrong value. The IIFE bundle cannot be used by bundlers and if so, there are errors at runtime.
The current value makes the bpmn-visualization integration painful for bundlers that use the browser field in priority in web projects. For instance, this is the behavior of Webpack and Parcel.
Their default configuration does not work out of the box, so users may give up prior creating an issue/question and/or check the bpmn-visualization-examples repository.
We have found and documented workarounds, but they have significant drawbacks.
The only alternative is to edit the package.json in the local node_modules (manually, with scripts, with https://www.npmjs.com/package/patch-package, ....) to use the ESM bundle instead. This makes the integration hard to do.
Proposal
Set the field to ESM or remove it as we already configure the module field
Here is the purpose of the browser field according to the npm documentation
If your module is meant to be used client-side the browser field should be used instead of the main field. This is helpful to hint users that it might rely on primitives that aren't available in Node.js modules. (e.g. window)
Describe the bug
The current value of the
browser
field in the package.json is set to the IIFE bundle file and it is a wrong value. The IIFE bundle cannot be used by bundlers and if so, there are errors at runtime.The current value makes the bpmn-visualization integration painful for bundlers that use the browser field in priority in web projects. For instance, this is the behavior of Webpack and Parcel.
Their default configuration does not work out of the box, so users may give up prior creating an issue/question and/or check the
bpmn-visualization-examples
repository.We have found and documented workarounds, but they have significant drawbacks.
bpmn-visualization
and has no impact on the rest of the project. However, it causes [INFRA] The Parcel TS project is not udpated correctly by the script updating the bpmn-visualization version bpmn-visualization-examples#351mainFields
in theresolve
configuration as shown in https://github.com/process-analytics/bpmn-visualization-examples/blob/v0.26.1/projects/javascript-vanilla-with-webpack/webpack.config.js#L29-L32browser
field may be mandatory for other dependencies and this may prevent integration of bpmn-visualization in such projects. See this feedback about an Angular project: TypeError when calling the BpmnVisualization constructor in a Angular 11 project #2221Proposal
Set the field to ESM or remove it as we already configure the module field
Here is the purpose of the
browser
field according to the npm documentationAdditional context
See also #2230
The text was updated successfully, but these errors were encountered: