PWA blank page after uploading cloud functions

I have a PWA that uses Firebase as database and Firebase Hosting.

The PWA works perfectly when I build it locally using ionic serve.

Without functions, PWA also deploys on Firebase Hosting and works well there.

When I create a cloud function and deploy it using “firebase deploy --only functions,” to the same project, the main page turns into a blank page and I only see an empty white screen. I cannot access any of the pages either.

I have tested this thoroughly and the only thing that makes a difference is uploading cloud functions. Cloud functions that I upload work well too when tested on the database.

Does anybody have any higher level advice about where to look and what might cause the problem?

If you need me to share any more information, please let me know. The issue seemed so general that I do not know what to share.

Thank you. My package.json is:

{
    "name": "...",
    "version": "1.1.9",
    "author": "...,
    "homepage": "...",
    "private": true,
    "scripts": {
        "start": "ionic-app-scripts serve",
        "clean": "ionic-app-scripts clean",
        "build": "ionic-app-scripts build",
        "lint": "ionic-app-scripts lint"
    },
    "dependencies": {
        "@angular/animations": "5.2.11",
        "@angular/common": "5.2.11",
        "@angular/compiler": "5.2.11",
        "@angular/compiler-cli": "5.2.11",
        "@angular/core": "5.2.11",
        "@angular/forms": "5.2.11",
        "@angular/http": "5.2.11",
        "@angular/platform-browser": "5.2.11",
        "@angular/platform-browser-dynamic": "5.2.11",
        "@ionic-native/core": "~4.10.0",
        "@ionic-native/splash-screen": "~4.10.0",
        "@ionic-native/status-bar": "~4.10.0",
        "@ionic/storage": "2.1.3",
        "angularfire2": "^5.0.0-rc.6",
        "chart.js": "^2.8.0",
        "crypto-js": "^3.1.9-1",
        "firebase": "^4.12.1",
        "geofire": "^4.1.2",
        "ionic-angular": "3.9.2",
        "ionicons": "3.0.0",
        "mapbox-gl": "^0.49.0-beta.1",
        "ngx-qrcode2": "0.0.9",
        "rxjs": "5.5.11",
        "sw-toolbox": "3.6.0",
        "zone.js": "0.8.26"
    },
    "devDependencies": {
        "@ionic/app-scripts": "3.1.11",
        "typescript": "^3.1.3"
    },
    "description": "An Ionic project"
}