Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

connorm's avatar

Vapor Deploy - Impossibly slow front end build step

I can't exactly pinpoint when, but sometime in the past 3 months, deploying my build to any of my environments went from taking a handful of minutes, now taking well over 45+ minutes, sometimes even an hour+.

From watching the Vapor CLI during the deploy, it seems to hang just on the front end build step - which is just npm ci && npm run prod && rm -rf node_modules. The big mystery is why it shows "Compiling Mix" for the next ~45 minutes each time I deploy.

For reference, here is my Vapor.yml file:

id: 12345
name: foobar
environments:
    production:
        memory: 1024
        cli-memory: 512
        runtime: docker
        build:
            - 'composer install --no-dev'
            - 'php artisan event:cache'
            - 'npm ci && npm run prod && rm -rf node_modules'
        domain: foobar.com
        database: FooBar
        storage: foobar-store
    staging:
        memory: 1024
        cli-memory: 512
        runtime: docker
        build:
            - 'composer install --no-dev'
            - 'php artisan event:cache'
            - 'npm ci && npm run dev && rm -rf node_modules'
        domain: staging.foobar.com
        database: FooBar
        storage: foobar-store

I realize an answer might not be so obvious, but does anyone have any advice on at least how I could begin to debug this? I am running Laravel 9 using Inertia, Vue 3, and Tailwind. If it helps, this is my package.json file as well:

{
    "private": true,
    "scripts": {
        "dev": "mix",
        "watch": "mix watch",
        "watch-poll": "mix watch -- --watch-options-poll=1000",
        "hot": "mix watch --hot",
        "prod": "mix --production"
    },
    "devDependencies": {
        "@headlessui/vue": "^1.6.4",
        "@inertiajs/inertia": "^0.11.0",
        "@tailwindcss/forms": "^0.5.2",
        "@tailwindcss/typography": "^0.5.2",
        "@vue/babel-plugin-jsx": "^1.1.1",
        "@vue/compiler-sfc": "^3.2.20",
        "alpinejs": "^2.8.2",
        "autoprefixer": "^10.4.7",
        "axios": "^0.27.2",
        "browser-sync": "^2.27.9",
        "browser-sync-webpack-plugin": "^2.3.0",
        "cross-env": "^7.0",
        "laravel-mix": "^6.0.34",
        "lodash": "^4.17.21",
        "postcss": "^8.4.14",
        "postcss-import": "^12.0.1",
        "prettier": "2.6.2",
        "prettier-plugin-tailwindcss": "^0.1.11",
        "resolve-url-loader": "^3.1.4",
        "tailwindcss": "^3.0.24",
        "vue": "^3.2.20",
        "vue-loader": "^16.8.1",
        "vue-stripe-js": "^1.0.0"
    },
    "dependencies": {
        "@heroicons/vue": "^1.0.4",
        "@inertiajs/inertia-vue3": "^0.6.0",
        "@inertiajs/progress": "^0.2.6",
        "@stripe/stripe-js": "^1.22.0",
        "date-fns": "^2.25.0",
        "libphonenumber-js": "^1.9.38",
        "luxon": "^1.28.0",
        "momentum-paginator": "^0.1.5",
        "pinia": "^2.0.14",
        "vue3-popper": "^1.3.0",
        "ziggy": "^2.4.0",
        "ziggy-js": "^1.4.6"
    }
}
0 likes
2 replies
goddas's avatar

I have the same issue, takes good 15min to get passed that step. Did you ever figure out the issue?

connorm's avatar

@goddas In my case, my local Node version was too low. I work on an a separate older project that is stuck on Node 12.x, and forgot to change it back to 18.x. I make a mental note to do this every time I deploy now. Once I did that, all of my deployments going forward stay in the 2-4 min range.

Please or to participate in this conversation.