Aggregating Javascript files breaks JS
This is commonly a result of loading theme javascript before it's dependencies. 

If your theme lists multiple external js dependencies, or just has multiple custo. Javascript files, you may need to assign weights to establish a load order. Refer to
https://www.drupal.org/docs/8/theming/adding-stylesheets-css-and-javascript-js-to-a-drupal-8-theme

Likewise, if your theme depends on other javascript provided by other modules, be sure to list those dependencies in your theme.info.yml file.

After making any of the above changes, clear Drupal caches with aggregation turned on and retest.