Failed to compile assets; syntax errors in javascript files

I am trying to install gitlab (10.4.2) from source on a server (running Slackware Linux) that is on an isolated network. I have gotten to the step where the assets are being compiled [sudo -u git -H bundle exec rake gitlab:assets:compile RAILS_ENV=production NODE_ENV=production]. When it gets to the section where it calls the .../.bin/webpack --config .../webpack-config.js command, it appears to build the first several .js files and then returns a Syntax Error when compiling the ./render_mermaid.js file; stating that it does not recognize import and export statements. This is followed by several more files with similar Syntax Errors and ultimately leads to the rake command failing.

I apologize that I do not have exact error messages to copy and paste since the server is on a network where I cannot copy the exact error messages; however, I am assuming the javascript files have been thoroughly tested and do not, in fact, have syntax errors, but rather I have an older version of 'something" (java jdk, rake, webpack, babel, etc…) that does not recognize the syntax being used in these files. Unfortunately, I do not know what that “something” may be. Any help would be appreciated. Thanks.


To provide a little more clarification of the errors I am receiving, I’ll summarize as much as I can below:

#$> sudo -u git -H bundler exec rake gitlab:assets:compile RAILS_ENV=production NODE_ENV=production

created app.js in /path/to/gitlab/assets/javascripts/locale/bg

All Files created, make sure they are being added to your assets.

/path/to/gitlab/node_modules/.bin/webpack --config /path/to/gitlab/config/webpack.config.js -- bail
Hash: 5124db186849b14881b4
Version: webpack 3.5.5
Time: 46224 ms
253 assets
[./promethus_metrics/index.js] ./promethus_metrics/index.js 197 bytes {promethus_metrics} [built]
[multi vendor/u2f] multi vendor/u2f 28 bytes {u2f} [built]
+ 862 hidden modules
ERROR in ./render_mermaid.js
Module build failed: Syntax Error: 'import' and 'export' may only appear at the top level (20:2)
if (!$els.length) return;

> import( 'blackst0ne-mermaid').then((mermaid => {
mermaid.initilize ({

mermaid : {

@ ./render_gfm.js 2:0-45
@ ./main.js

ERROR in ./filtered_search_dropdown_emoji.js

rake aborted!
Command failed with status (2): [...]
/path/to/gitlab/vendor/bundle/ruby/2.4.0/gems/webpack-rails-0.9.10/lib/tasks/webpack.rake:17: in
'block (2 levels) in <top (require)>'
Tasks: TOP => gitlab:assets:compile => webpack:compile

The actual error message is rather long, stating more Syntax Errors in other files.

Here is a list of the support program versions I currently have installed:
ruby :: 2.4.3p205
gem :: 2.6.14
rake :: 12.3.0
yarn :: 1.3.2
go :: 1.9.2
bundler :: 1.16.1
node js :: 9.5.0 (I’ve also tried 7.10.1 and 8.9.4)

I used the Gemfile, Gemfile.lock, and yarn.lock files as a guideline for downloading the gem and js dependencies. So I do not believe those are an issue; however, webpack (v.3.5.5) does seem to be producing the error, so I wonder if that has something to do with it.

If I cannot compile the assets myself, is there a way to download pre-compiled assets to install instead?

Once again, any help would be appreciated. Thanks.