Sometimes to troubleshoot errors with webpack bundling, we have to run webpack directly.

# cd /usr/share/gitlab
# gitlab_user=gitlab
# runuser -u ${gitlab_user} -- sh -c 'NODE_ENV="production" NODE_OPTIONS="--max-old-space-size=4096" webpack --config config/webpack.config.js'

This command is also found in /usr/lib/gitlab/scripts/rake-tasks.sh