Build from git not working properly

Hi!

I am currently facing an issue with the build of the camunda-bpm-webapp repository. I tried everything according to the development section in the readme.md, but unfortunately, this wasn’t successful. I’ve tried to build the master and 7.12.0-alpha2 - both unsuccessful.

The error I am facing (when running mvn jetty:run -Pdevelop and accessing http://localhost:8080/camunda/app/welcome/default/) is the following:

camunda-welcome-ui.js?bust=7.12.0-SNAPSHOT-1566809830592:18 Uncaught TypeError: r is not a function
    at Object.250.../internals/export (camunda-welcome-ui.js?bust=7.12.0-SNAPSHOT-1566809830592:18)
    at c (camunda-welcome-ui.js?bust=7.12.0-SNAPSHOT-1566809830592:18)
    at camunda-welcome-ui.js?bust=7.12.0-SNAPSHOT-1566809830592:18
    at Object.213.../internals/function-to-string (camunda-welcome-ui.js?bust=7.12.0-SNAPSHOT-1566809830592:18)
    at c (camunda-welcome-ui.js?bust=7.12.0-SNAPSHOT-1566809830592:18)
    at camunda-welcome-ui.js?bust=7.12.0-SNAPSHOT-1566809830592:18
    at Object.272.../internals/object-to-string (camunda-welcome-ui.js?bust=7.12.0-SNAPSHOT-1566809830592:18)
    at c (camunda-welcome-ui.js?bust=7.12.0-SNAPSHOT-1566809830592:18)
    at camunda-welcome-ui.js?bust=7.12.0-SNAPSHOT-1566809830592:18
    at Object.254.../internals/descriptors (camunda-welcome-ui.js?bust=7.12.0-SNAPSHOT-1566809830592:18)
camunda-welcome-bootstrap.js?bust=7.12.0-SNAPSHOT-1566809830592:18 Uncaught TypeError: Cannot read property 'exposePackages' of undefined
    at camunda-welcome-bootstrap.js?bust=7.12.0-SNAPSHOT-1566809830592:18
    at Object.execCb (require.js:1)
    at e.check (require.js:1)
    at e.<anonymous> (require.js:1)
    at require.js:1
    at require.js:1
    at each (require.js:1)
    at emit (require.js:1)
    at e.check (require.js:1)
    at enable (require.js:1)

The version of my tools are:
npm: 6.10.2 / 6.11.2 (both tested)
mvn: 3.6.1
grunt-cli: 1.3.2
grunt: 1.0.4

I added the stuff to the settings.xml of maven and installed grunt globally as the description stated it. However, it just refuses to work after compile. Is there any known pitfall or is it just me missing something?

Thanks for the help :slight_smile:

Hi @mhoffmann,

Can you explain why do you need to build the webapps from source? Are you making any modifications?

One thing to note is that we usually run our tests with Maven 3.2.5. I will have to check for the npm version.

Best,
Nikoa

Hi Nikola,

I’m actually planning on developing a tasklist plugin and have some modifications planned, therefore I guess I would need the build from the source sooner or later.

Regarding the plugin: I just planned on using already existing endpoints (which could shift in the feature though) which therefore wouldn’t really require a server-sided plugin. I just want to add some addtional details in a new menu point on tasklist.task.detail.

As I searched through the files of the webapp repository, I found some plugins there which led me to the conclusion that you don’t have to pack this as a jar (which would be great regarding the speed of deployment and debugging).

For the plugin, I could still use the jar way, that wouldn’t be much of an issue, but it still wouldn’t solve the problem that I am not able to build the webabb repository from scratch. I guess I am giving Maven 3.2.5 a try though and maybe try to build it on another computer.

I will get back to you if I have any further information :slight_smile:

Hi @nikola.koevski,

I’ve tried to build it on another computer yesterday. Same outcome, even with Maven 3.2.5.

However, I have disabled the uglify plugin and now the stack trace is the following:

Navigated to http://localhost:8080/camunda/app/welcome/default/
es.array.map.js:3 Uncaught TypeError: $ is not a function
    at Object.250.../internals/export (es.array.map.js:3)
    at o (NavigatedViewer.js:6)
    at NavigatedViewer.js:6
    at Object.213.../internals/function-to-string (redefine.js:7)
    at o (NavigatedViewer.js:6)
    at NavigatedViewer.js:6
    at Object.272.../internals/object-to-string (es.promise.finally.js:2)
    at o (NavigatedViewer.js:6)
    at NavigatedViewer.js:6
    at Object.254.../internals/descriptors (es.function.name.js:12)
250.../internals/export @ es.array.map.js:3
o @ NavigatedViewer.js:6
(anonymous) @ NavigatedViewer.js:6
213.../internals/function-to-string @ redefine.js:7
o @ NavigatedViewer.js:6
(anonymous) @ NavigatedViewer.js:6
272.../internals/object-to-string @ es.promise.finally.js:2
o @ NavigatedViewer.js:6
(anonymous) @ NavigatedViewer.js:6
254.../internals/descriptors @ es.function.name.js:12
o @ NavigatedViewer.js:6
(anonymous) @ NavigatedViewer.js:6
277.../internals/an-object @ es.regexp.to-string.js:5
o @ NavigatedViewer.js:6
(anonymous) @ NavigatedViewer.js:6
275.../internals/descriptors @ es.regexp.constructor.js:8
o @ NavigatedViewer.js:6
(anonymous) @ NavigatedViewer.js:6
284.../internals/advance-string-index @ es.string.split.js:7
o @ NavigatedViewer.js:6
(anonymous) @ NavigatedViewer.js:6
173.../internals/classof-raw @ indexed-object.js:7
o @ NavigatedViewer.js:6
(anonymous) @ NavigatedViewer.js:6
232.../internals/indexed-object @ to-integer.js:6
o @ NavigatedViewer.js:6
(anonymous) @ NavigatedViewer.js:6
249.../internals/add-to-unscopables @ es.array.iterator.js:17
o @ NavigatedViewer.js:6
(anonymous) @ NavigatedViewer.js:6
(anonymous) @ global.js:7
166.core-js/modules/es.array.iterator @ hidden-keys.js:1
o @ NavigatedViewer.js:6
(anonymous) @ NavigatedViewer.js:6
209.../internals/global @ perform.js:1
o @ NavigatedViewer.js:6
(anonymous) @ NavigatedViewer.js:6
152.../internals/has @ define-well-known-symbol.js:6
o @ NavigatedViewer.js:6
(anonymous) @ NavigatedViewer.js:6
288.../internals/define-well-known-symbol @ es.symbol.js:1
o @ NavigatedViewer.js:6
(anonymous) @ NavigatedViewer.js:6
180.core-js/modules/es.array.iterator @ is-object.js:1
o @ NavigatedViewer.js:6
(anonymous) @ NavigatedViewer.js:6
252.../internals/array-method-has-species-support @ es.array.slice.js:13
o @ NavigatedViewer.js:6
(anonymous) @ NavigatedViewer.js:6
287.../internals/copy-constructor-properties @ es.symbol.description.js:8
o @ NavigatedViewer.js:6
(anonymous) @ NavigatedViewer.js:6
289.../internals/an-object @ es.symbol.js:1
o @ NavigatedViewer.js:6
(anonymous) @ NavigatedViewer.js:6
157.../internals/copy-constructor-properties @ export.js:1
o @ NavigatedViewer.js:6
(anonymous) @ NavigatedViewer.js:6
242.../internals/array-method-has-species-support @ es.array.concat.js:10
o @ NavigatedViewer.js:6
(anonymous) @ NavigatedViewer.js:6
817.../../../common/scripts/module @ camunda-welcome-ui.js:26
o @ NavigatedViewer.js:6
r @ NavigatedViewer.js:6
(anonymous) @ NavigatedViewer.js:6
(anonymous) @ NavigatedViewer.js:6
(anonymous) @ NavigatedViewer.js:6
Show 37 more frames
camunda-welcome-bootstrap.js?bust=7.12.0-SNAPSHOT-1566981241219:48 Uncaught TypeError: Cannot read property 'exposePackages' of undefined
    at camunda-welcome-bootstrap.js?bust=7.12.0-SNAPSHOT-1566981241219:48
    at Object.execCb (require.js:1696)
    at Module.check (require.js:883)
    at Module.<anonymous> (require.js:1139)
    at require.js:134
    at require.js:1189
    at each (require.js:59)
    at Module.emit (require.js:1188)
    at Module.check (require.js:938)
    at Module.enable (require.js:1176)
(anonymous) @ camunda-welcome-bootstrap.js?bust=7.12.0-SNAPSHOT-1566981241219:48
execCb @ require.js:1696
check @ require.js:883
(anonymous) @ require.js:1139
(anonymous) @ require.js:134
(anonymous) @ require.js:1189
each @ require.js:59
emit @ require.js:1188
check @ require.js:938
enable @ require.js:1176
init @ require.js:788
callGetModule @ require.js:1203
completeLoad @ require.js:1611
onScriptLoad @ require.js:1717
load (async)
req.load @ require.js:1942
load @ require.js:1685
load @ require.js:834
fetch @ require.js:824
check @ require.js:856
enable @ require.js:1176
enable @ require.js:1557
(anonymous) @ require.js:1161
(anonymous) @ require.js:134
each @ require.js:59
enable @ require.js:1113
enable @ require.js:1557
(anonymous) @ require.js:1161
(anonymous) @ require.js:134
each @ require.js:59
enable @ require.js:1113
init @ require.js:788
(anonymous) @ require.js:1460
setTimeout (async)
req.nextTick @ require.js:1815
localRequire @ require.js:1449
requirejs @ require.js:1797
(anonymous) @ camunda-welcome-bootstrap.js?bust=7.12.0-SNAPSHOT-1566981241219:169

And that’s the point where I am really out of ideas. It kind of bothers me that a function of the core-js fails at first and therefore I’ve tried to update that library to the newest version but that didn’t change anything and I couldn’t a bug in their issue tracker. (Maybe not running uglify breaks something else?)

@mhoffmann,

I’m not sure what the problem might be. Since I’m a backend engineeer, I’m afraid I can’t help you much with frontend errors/libraries. Maybe someone else from the community can help you. @tasso94 maybe you have some input?

Best,
Nikola

Hi @mhoffmann,

I tried to recreate the problem you are facing, but it works for me. We use a rather old node version to build the projects (node v8.11.1, npm 5.6.0).

To help me get to the source of the problem, can you

  1. delete package-lock and node_modules and run npm i and grunt again
  2. if this does not work, check if you can build the tag 7.11.0

We changed how we bundle some of our dependencies since 7.11. This seems to be related.

KR
Martin

Hi @martin.stamm,

thanks for your reply!

  1. This didn’t change a thing, still got the same errors :confused:
  2. This seems to wrok, so I guess the way you bundle your dependencies is now broken for newer versions of node and npm?

Should I open a bug on JIRA about this?

Cheers!
Mario

Hey @mhoffmann,

thanks for getting back to me. Feel free to create a JIRA issue about this, we can further discuss the bug there.
I just tried to reproduce it using node v12.9.1 and npm 6.10.2, but it still works :confused:

Please also include in the Ticket:

  • Node & npm Version
  • Browser & OS

Cheers
Martin

This just came up with a colleague who has the same problem. It might be related to windows.
I’ll keep you updated

2 Likes

Hi @mhoffmann,

Good news, you can now build from master again :slight_smile:

The Problem was caused by a Regex which did not account for Windows paths (\ instead of /) and caused some polyfills to break.

Thank you for bringing it to our attention!

Best Regards
Martin

1 Like

Hi @nikola.koevski Any Idea how to pass jwt token to webapp so that we can add a filter which decodes jwt and passes on the authenticated user details to ContainerBasedAuthenticationFilter ?