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

Fix: TypeError: BpmnModdle is not a constructor (at work with es modules) #31

Closed

Conversation

corocoto
Copy link
Contributor

@corocoto corocoto commented Mar 30, 2023

Description

I met with this error again, when using es modules. To fix this problem, I decided to use 'OR' condition to get truly BpmnModdle class for both available types (commonjs, es modules). I believe that this PR fully closes and resolves the BpmnModdle is not a constructor error.

Related PRs:

Related issues:

@corocoto corocoto changed the title Fix: TypeError: BpmnModdle is not a constructor (#2) Fix: TypeError: BpmnModdle is not a constructor (at work with es modules) Mar 30, 2023
@nikku
Copy link
Member

nikku commented Mar 30, 2023

I met with this error again, when using es modules. To fix this problem, I decided to use 'OR' condition to get truly BpmnModdle class for both available types (commonjs, es modules). I believe that this PR fully closes and resolves the BpmnModdle is not a constructor error.

How do you try to consume this library?

I think we want to settle on a library target (is this ES or CJS modules), clean this up, and potentially provide a pre-built distribution for it (that works independent of the usage context).

You'll likely run into troubles otherwise, depending how you include things.

@corocoto
Copy link
Contributor Author

How do you try to consume this library?

I transform input JSON data, received from the backend side, to the BPMN object. After the previous step, I continue to construct the BPMN structure by adding DI elements and their own positions and sizes. In the end, I display the result on the page.

@corocoto
Copy link
Contributor Author

corocoto commented Mar 30, 2023

I think we want to settle on a library target (is this ES or CJS modules), clean this up, and potentially provide a pre-built distribution for it (that works independent of the usage context).

You'll likely run into troubles otherwise, depending how you include things.

Hm, you're right, @nikku. I think it's the correct view of things. So, after our discussion, I decided to close this PR, because it became irrelevant.

@corocoto corocoto closed this Mar 30, 2023
@nikku
Copy link
Member

nikku commented Mar 30, 2023

#31 (comment)

From ES or CJS context? In the browser or in NodeJS?

@corocoto
Copy link
Contributor Author

corocoto commented Mar 30, 2023

@nikku, from ES context (in the browser environment)

@corocoto corocoto reopened this Apr 3, 2023
@barmac barmac requested a review from nikku April 17, 2023 14:23
@nikku
Copy link
Member

nikku commented May 9, 2023

@corocoto Unfortunately we were not able to follow up on this PR on time. We'll close this for the time being and hope that we can revive this project some time in the future.

@nikku nikku closed this May 9, 2023
@corocoto corocoto deleted the fix/BpmnModdle-is-not-a-constructor branch May 20, 2023 15:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants