Terser Failed for Unknown Reason

I created an ionic 4 app awhile ago and through upgrading to ionic 5 and now ionic 6, I feel like i’ve lost control of the packages and what exactly is necessary. After the Ionic 6 and then ESLint update was all said and done, I’m getting the below error upon ionic cordova build ios --prod. I’ve tried updating every plugin and package I could think of, and that google search people could think of. But I still have a disconnect somewhere. Sorry for the giant dump below.

This is what it shows without --verbose:
Error: Optimization error [scripts.[contenthash:20].js]: Error: Terser failed for unknown reason.

This is with --verbose:
ERROR in Optimization error [scripts.[contenthash:20].js]: Error: Terser failed for unknown reason. at optimizeWithTerser (/node_modules/@angular-devkit/build-angular/src/webpack/plugins/javascript-optimizer-worker.js:137:15) at processTicksAndRejections (internal/process/task_queues.js:95:5) at async default_1 (/node_modules/@angular-devkit/build-angular/src/webpack/plugins/javascript-optimizer-worker.js:29:26) at async /node_modules/piscina/dist/src/worker.js:141:26 Error: Optimization error [scripts.[contenthash:20].js]: Error: Terser failed for unknown reason. at optimizeWithTerser (/node_modules/@angular-devkit/build-angular/src/webpack/plugins/javascript-optimizer-worker.js:137:15) at processTicksAndRejections (internal/process/task_queues.js:95:5) at async default_1 (/node_modules/@angular-devkit/build-angular/src/webpack/plugins/javascript-optimizer-worker.js:29:26) at async /node_modules/piscina/dist/src/worker.js:141:26 at /node_modules/@angular-devkit/build-angular/src/webpack/plugins/javascript-optimizer-plugin.js:154:55 at async Promise.all (index 0) at async /node_modules/@angular-devkit/build-angular/src/webpack/plugins/javascript-optimizer-plugin.js:158:21


ng version:
`Angular CLI: 14.2.3
Node: 16.17.1
Package Manager: npm 8.19.2
OS: darwin x64

Angular: 14.2.3
… animations, cli, common, compiler, compiler-cli, core, forms
… language-service, platform-browser, platform-browser-dynamic
… pwa, router

Package Version

@angular-devkit/architect 0.1402.3
@angular-devkit/build-angular 14.2.3
@angular-devkit/core 14.2.3
@angular-devkit/schematics 14.2.3
@angular/cdk 14.2.2
@angular/fire 7.4.1
@angular/material 14.2.2
@schematics/angular 14.2.3
rxjs 7.5.7
typescript 4.7.3`


package.json
“dependencies”: {
@angular-devkit/build-angular”: “^14.2.3”,
@angular/animations”: “^14.2.3”,
@angular/cdk”: “^14.2.2”,
@angular/common”: “^14.2.3”,
@angular/core”: “^14.2.3”,
@angular/fire”: “^7.4.1”,
@angular/forms”: “^14.2.3”,
@angular/material”: “^14.2.2”,
@angular/platform-browser”: “^14.2.3”,
@angular/platform-browser-dynamic”: “^14.2.3”,
@angular/pwa”: “^14.2.3”,
@angular/router”: “^14.2.3”,
@awesome-cordova-plugins/app-version”: “^5.45.0”,
@awesome-cordova-plugins/core”: “^5.45.0”,
@awesome-cordova-plugins/firebase”: “^5.45.0”,
@awesome-cordova-plugins/in-app-browser”: “^5.45.0”,
@awesome-cordova-plugins/keyboard”: “^5.45.0”,
@awesome-cordova-plugins/market”: “^5.45.0”,
@awesome-cordova-plugins/onesignal”: “^5.45.0”,
@awesome-cordova-plugins/open-native-settings”: “^5.45.0”,
@awesome-cordova-plugins/social-sharing”: “^5.45.0”,
@awesome-cordova-plugins/splash-screen”: “^5.45.0”,
@awesome-cordova-plugins/status-bar”: “^5.45.0”,
@fortawesome/angular-fontawesome”: “^0.11.1”,
@fortawesome/fontawesome-svg-core”: “^6.2.0”,
@fortawesome/free-regular-svg-icons”: “^6.2.0”,
@fortawesome/free-solid-svg-icons”: “^6.2.0”,
@ionic/angular”: “^6.2.8”,
@ionic/cli”: “^6.20.1”,
@ionic/cordova-builders”: “^7.0.0”,
@ionic/pro”: “2.0.4”,
@ionic/storage”: “^3.0.6”,
@ionic/storage-angular”: “^3.0.6”,
@sendgrid/mail”: “^7.3.0”,
@types/node”: “^18.7.18”,
“angular-animations”: “^0.11.0”,
“cordova-browser”: “6.0.0”,
“cordova-plugin-app-version”: “^0.1.14”,
“cordova-plugin-device”: “^2.1.0”,
“cordova-plugin-file”: “^7.0.0”,
“cordova-plugin-file-transfer”: “^1.7.1”,
“cordova-plugin-firebasex”: “^14.2.1”,
“cordova-plugin-inappbrowser”: “^5.0.0”,
“cordova-plugin-ionic”: “^5.5.2”,
“cordova-plugin-ionic-keyboard”: “^2.2.0”,
“cordova-plugin-ionic-webview”: “^5.0.0”,
“cordova-plugin-splashscreen”: “^6.0.1”,
“cordova-plugin-statusbar”: “^3.0.0”,
“cordova-plugin-whitelist”: “^1.3.4”,
“cordova-plugin-x-socialsharing”: “^6.0.3”,
“core-js”: “^3.6.5”,
“crypto-js”: “^4.1.1”,
“es6-promise-plugin”: “^4.2.2”,
“firebase”: “^9.10.0”,
“google-libphonenumber”: “^3.2.13”,
“ion2-calendar”: “^3.5.0”,
“jquery”: “^3.5.1”,
“jquery-ui-dist”: “^1.12.1”,
“libphonenumber-js”: “^1.8.4”,
“linkify-html”: “^4.0.0”,
“linkifyjs”: “^4.0.0”,
“mat-table-exporter”: “^10.2.4”,
“moment”: “^2.29.1”,
“ngx-currency”: “^2.5.2”,
“onesignal-cordova-plugin”: “^3.0.3”,
“restler”: “^2.0.1”,
“rxjs”: “7.5.7”,
“terser”: “5.15.0”,
“text-mask-addons”: “^3.8.0”,
“tslib”: “^2.3.0”,
“zone.js”: “^0.11.4”
},
“devDependencies”: {
@angular-eslint/eslint-plugin”: “^14.1.2”,
@angular/cli”: “^14.2.3”,
@angular/compiler”: “^14.2.3”,
@angular/compiler-cli”: “^14.2.3”,
@angular/language-service”: “^14.2.3”,
@ionic/angular-toolkit”: “^7.0.0”,
@ionic/lab”: “^3.2.9”,
@types/jasmine”: “^4.3.0”,
@types/jasminewd2”: “^2.0.8”,
@typescript-eslint/eslint-plugin”: “^5.38.0”,
@typescript-eslint/eslint-plugin-tslint”: “^5.38.0”,
@typescript-eslint/parser”: “^5.38.0”,
“codelyzer”: “^6.0.2”,
“cordova-android”: “^11.0.0”,
“cordova-ios”: “^6.2.0”,
“cordova-open-native-settings”: “^1.5.5”,
“cordova-plugin-androidx”: “^3.0.0”,
“cordova-plugin-androidx-adapter”: “^1.1.3”,
“cordova-plugin-market”: “^1.2.0”,
“cordova-sqlite-storage”: “^6.0.0”,
“eslint”: “^8.24.0”,
“eslint-plugin-import”: “^2.26.0”,
“eslint-plugin-jsdoc”: “^39.3.6”,
“jasmine-core”: “~4.4.0”,
“jasmine-spec-reporter”: “~7.0.0”,
“karma”: “~6.4.1”,
“karma-chrome-launcher”: “~3.1.0”,
“karma-coverage-istanbul-reporter”: “^3.0.3”,
“karma-jasmine”: “~5.1.0”,
“karma-jasmine-html-reporter”: “^2.0.0”,
“protractor”: “^7.0.0”,
“ts-node”: “~10.9.1”,
“typescript”: “4.7.3”
},
“description”: “xxxxxxxx”,
“cordova”: {
“plugins”: {
“cordova-plugin-x-socialsharing”: {},
“cordova-plugin-ionic”: {
“APP_ID”: “xxxxxxxx”,
“CHANNEL_NAME”: “Master”,
“UPDATE_METHOD”: “auto”,
“UPDATE_API”: “https://api.ionicjs.com”,
“MAX_STORE”: “2”,
“MIN_BACKGROUND_DURATION”: “30”
},
“cordova-plugin-whitelist”: {},
“cordova-plugin-statusbar”: {},
“cordova-plugin-device”: {},
“cordova-plugin-splashscreen”: {},
“cordova-plugin-ionic-webview”: {},
“cordova-plugin-ionic-keyboard”: {},
“cordova-plugin-app-version”: {},
“onesignal-cordova-plugin”: {},
“cordova-plugin-inappbrowser”: {},
“cordova-sqlite-storage”: {},
“cordova-open-native-settings”: {},
“cordova-plugin-market”: {},
“cordova-plugin-firebasex”: {}
},
“platforms”: [
“browser”,
“android”,
“ios”
]
}
}