camunda / camunda-bpm-platform

Flexible framework for workflow and decision automation with BPMN and DMN. Integration with Quarkus, Spring, Spring Boot, CDI.
https://camunda.com/
Apache License 2.0
4.11k stars 1.55k forks source link

Enterprise frontend build doesn't work on Windows #2824

Closed ThorbenLindhauer closed 1 year ago

ThorbenLindhauer commented 2 years ago

This issue was imported from JIRA:

Field Value
JIRA Link CAM-14912
Reporter @tasso94
Has restricted visibility comments false

 Context

When building the enterprise webapps, the following error is shown:

     <exec> Running "ensureLibs:thirdParty" (ensureLibs) task
     <exec> C:\<truncated>\camunda-bpm-platform-ee\webapps\camunda-webapp\plugins\node_modules\process\browser.js has no license file. :shrug:▒?
     <exec> Fatal error: Cannot find module 'C:\<truncated>\camunda-bpm-platform-ee\webapps\camunda-webapp\plugins/node*modules/camunda-bpm-webapp/node_modules/C:\<truncated>\\camunda-bpm-platform-ee\webapps\camunda-webapp\plugins\node*modules\process\browser.js/package.json'

Acceptance Criteria (Required on creation):

Enterprise frontend build works with Windows.

Hints (optional):

-

Links:

Andyjc3 commented 2 years ago

Have you solved this question?

ThorbenLindhauer commented 2 years ago

No, the issue is still open.

tasso94 commented 2 years ago

Hi @Andyjc3,

I'll take care of this issue in the course of my community work.

Stay tuned!

Best, Tassilo

ThorbenLindhauer commented 2 years ago

The root cause is that the following code assumes / to be the separator for package paths, which is correct for regular package dependencies but not for file-based dependencies on Windows where it's \: https://github.com/camunda/camunda-bpm-platform/blob/7.18.0/webapps/camunda-commons-ui/grunt/tasks/ensureLibs.js#L141-L151

Should probably use path.sep instead. Must be careful though that we cannot just replace the delimiter in the regular expressions.

As a hack fix I replaced row.file as follows: const rowFile = row.file.replace(/\\/g, '/');. Seemed to work (using Git Bash on Windows 10), but I don't understand the code fully, so you better check it yourself.

tasso94 commented 1 year ago

Hi @Andyjc3,

I appreciate your patience. I just tested Thorben's proposed fix on Windows, and it works like a charm. 👍

I'll create a PR and assign it for review.

Best, Tassilo

yanavasileva commented 1 year ago

Awesome, I tested the community and enterprise builds! Started spring boot started and all looks good.

yanavasileva commented 1 year ago

@tasso94, do we need to backport? At least one or two versions back?

tasso94 commented 1 year ago

Makes sense.