Skip to content
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

[BUG] The browser field in package.json is incorrect #2228

Closed
tbouffard opened this issue Sep 11, 2022 · 0 comments · Fixed by #2248
Closed

[BUG] The browser field in package.json is incorrect #2228

tbouffard opened this issue Sep 11, 2022 · 0 comments · Fixed by #2248
Assignees
Labels
bug Something isn't working lib integration Something about how an app can integrate the library
Milestone

Comments

@tbouffard
Copy link
Member

tbouffard commented Sep 11, 2022

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.

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)

Additional context
See also #2230

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working lib integration Something about how an app can integrate the library
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant