Skip to content
PACO3DWeb design, SEO and hosting
SEOHostingPortfolioPricing3D Modeling & PrintingAbout usContact us
Contact us

Domains for sale

  • SuccessHabits.comFor sale
  • BingoCard.comFor sale
  • ClickBranding.comFor sale
  • ContourCraft.comFor sale
  • eMirror.comFor sale
  • QuickHomes.comFor sale
  • TeleFunding.comFor sale
  • Oxicom.comFor sale
  • SleepSolutions.comFor sale
  • Bizfund.comFor sale
  • midwestequipment.comFor sale
  • InstaPIC.comFor sale
  • storagecard.comFor sale

Site management & digital operations

Need a hand with your digital presence?

Talk with Paco3D about website design, SEO, or ongoing site support.

P3DWeb studioPaco3DinLinkedIn · Site managerAlfredo KofmanAlfredoCsharpWhatsApp+1 423-480-3666@Email[email protected]▶YouTube@1Man4Riders◎Instagram@alfredo_kofmanTikTok@paco3dstudioX@Paco3DK
PACO3DWeb design, SEO and hosting

Complete digital solutions for ambitious small businesses.

Explore

Web designSEOHosting3D Modeling & PrintingSelected workPricingAbout usTerms of usePlan My WebsiteLanding pageGet in touch

Services

Web designHosting solutionsSEOAnalyticsPersonal guidance & assistanceProHostinger

Articles

Google Search Console: beginner’s guideCloudflare guideDeploying Vite Apps to Hostinger via GitHub ActionsLocal AI server with OllamaAI visibilityPage Speed
© 2026 Paco3D. All rights reserved.Built with care, for what comes next.

Deployment field guide · Paco3D

Deploying Vite Apps to Hostinger via GitHub Actions

Decomposing the white screen: automating Vite app deployments from GitHub to Hostinger shared hosting.

Vite + ReactGitHub ActionsHostinger FTPS

Deploying a modern JavaScript web application to a traditional shared hosting environment often introduces unexpected friction. Recently, while migrating a website built with Vite and React from manual file uploads to a continuous deployment pipeline using GitHub Actions and Hostinger, we hit a wall of common infrastructure pitfalls: broken DNS zones, strict browser MIME type errors, nested folder loops, and firewall data socket resets (ECONNRESET).

If you are trying to configure a modern web application deployment over traditional FTP/FTPS while keeping your domain email routing active and completely untouched, here is exactly what went wrong and how we engineered a pipeline to fix it.

THE ARCHITECTURE

The Core Challenge & Architecture Goal

LOCAL SETUP

VS Code environment tracking a modern web framework codebase bundled via npm run build.

REMOTE SETUP

Hostinger shared hosting handling both web asset storage (public_html) and custom business email addresses.

OBJECTIVE

Automate deployments so pushing code to GitHub compiles and transfers production assets to the server root, without modifying active MX/TXT records or breaking custom email accounts.

01 / DNS CONFIGURATION

The Broken DNS & getaddrinfo ENOTFOUND Failure

The mistake

Initially, connecting the repository directly inside Hostinger's dashboard reset the domain's DNS zone configuration back to hosting defaults, severing custom registrar connections. When switching to an automated pipeline, assigning standard domain addresses (like ://example.com) or including protocol prefixes (like ftp://194.xxx.xx.xx) inside the FTP_SERVER GitHub secret triggered immediate network lookup exceptions.

The fix

Bypass the Domain Name System during automated pipeline workflows. Fetch the raw numeric FTP IP address from your host provider dashboard and feed it directly into the GitHub repository secret without text prefixes or trailing slashes:

Incorrect: ftp://123.45.67.89Correct: 123.45.67.89

02 / MIME TYPES

The Infamous White Screen: Strict MIME Type Checking

The mistake

After a successful file transfer, loading the webpage returned a blank white screen. The browser console threw a fatal spec error:

“Expected a JavaScript-or-Wasm module script but the server responded with a MIME type of 'text/plain'. Strict MIME type checking is enforced...”

Traditional Apache servers do not natively know how to serve compiled modern ES module files (.js, .mjs) produced by tools like Vite, forcing them to download as plain text. Browsers reject these scripts on sight.

The fix

Add an explicit header enforcement file to your build template. Place a .htaccess file inside your project's public/ folder so your compiler copies it into the final production bundle, then instruct Apache to output the correct content headers.

📄 View the .htaccess configuration
<IfModule mod_mime.c>
  AddType application/javascript .js
  AddType application/javascript .mjs
</IfModule>

<FilesMatch "\.(js|mjs)
quot;> Header set Content-Type "application/javascript" </FilesMatch> <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.html$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-l RewriteRule . /index.html [L] </IfModule>

03 / CONNECTION STABILITY

The Shared Hosting Firewall Block: ECONNRESET

The mistake

When pushing dozens of compiled assets simultaneously, the deployment abruptly failed mid-upload with a “Client is closed because read ECONNRESET” exception. Shared hosting accounts enforce rate limits on port interactions; rapid, unencrypted concurrent connections can look like a cyberattack, triggering an automated server-side connection drop.

The fix

Use explicit TLS-encrypted FTPS and allocate longer internal network execution times to allow the server time to safely parse individual file chunks.

04 / SERVER PATHS

The Infinite Subfolder Loop: public_html/public_html

The mistake

Configuring the server directory path to /public_html/ caused a duplicate nested directory to appear on the server. Hostinger's default FTP configurations can root user logins inside the site's target folder. Telling the script to look for public_html/ then appends a new folder inside the one you're already in.

The fix

Remove the old state history tracker file (.ftp-deploy-sync-state.json) from the file manager to clear old sync records. Then configure the pipeline to deploy directly into the current authenticated root path (./) using a fresh custom sync signature name.

THE WORKFLOW

The Complete Solution: Production-Ready GitHub Workflow

Here is the final GitHub Actions workflow configuration, combining a build, artifact archive, and FTPS deployment. It uses a flat target path and a separate state file for deployment tracking.

🚀 View the main.yml workflow
name: Production - Build and Deploy App

on:
  push:
    branches:
      - main
  workflow_dispatch:

jobs:
  build-and-deploy:
    runs-on: ubuntu-latest

    steps:
      - name: Checkout repository
        uses: actions/checkout@v4

      - name: Setup Node.js Environment
        uses: actions/setup-node@v4
        with:
          node-version: 22
          cache: npm

      - name: Install Project Dependencies
        run: npm ci

      - name: Compile Production Build
        run: npm run build

      - name: Archive Production Build Artifacts
        uses: actions/upload-artifact@v4
        with:
          name: site-production-bundle
          path: dist/
          retention-days: 7

      - name: Sync Production Bundle to Hostinger via Secured FTPS
        uses: SamKirkland/[email protected]
        with:
          server: ${{ secrets.FTP_SERVER }}
          username: ${{ secrets.FTP_USERNAME }}
          password: ${{ secrets.FTP_PASSWORD }}
          local-dir: ./dist/
          server-dir: ./
          port: 21
          protocol: ftps
          security: loose
          state-name: .clean-production-sync.json
          timeout: 120000

TROUBLESHOOTING

Automated Deployment Checklist

If your pipeline encounters friction or the live environment triggers unexpected behavior, run these sanity checks sequentially.

📡 Pipeline connection failures

  • Clean the server secret: Verify FTP_SERVER does not contain prefixes like ftp:// or paths like /public_html. Use a raw numeric IP address or bare domain.
  • Verify account identifiers: Ensure FTP_USERNAME includes your host's account system prefix (for example, u123456789.username), not just your custom profile name.
  • Confirm firewall settings: If logs show an immediate ECONNRESET during folder setup, verify the protocol is explicitly set to ftps and the timeout is raised to 120000.

📂 File and directory path alignment

  • Locate build outputs: Run npm run build locally. If your framework outputs to a folder other than dist (such as build or out), update local-dir to match.
  • Eliminate subfolder loops: If the live site returns a 404 or files land in a nested folder, remove the redundant folder in File Manager and set server-dir to ./.
  • Purge cache states: If paths change but transfers still behave incorrectly, delete old tracking signatures such as .ftp-deploy-sync-state.json from host storage and use a fresh state-name.

🌐 Live browser render anomalies

  • Relocate server directives: Keep .htaccess inside the local source public/ directory so it is copied into the production build.
  • Test in isolation: If files upload successfully but changes do not appear, open an Incognito or Private window to bypass stale browser or edge network caching.
DEPLOY WITH CONFIDENCE

A repeatable build and deployment workflow can make routine site updates faster and easier to manage.

Talk about your website ↗
THE FOUR FIXES
  1. Use the right FTP server value
  2. Serve JavaScript with the correct MIME type
  3. Deploy over FTPS with enough time
  4. Target the authenticated server root