Pular para o conteúdo

Buscar na documentação

Buscar na documentação da Skiffly

React (Vite) ou Next.js no ar

Deploy a React app made with Vite, a Vue or Svelte app, or a Next.js project — static or with a server — from your computer or from GitHub, with environment variables, client-side routing and your own domain.

Most sites built with an AI assistant are one of two kinds: a Vite app (React, Vue, Svelte — what Lovable and Bolt generate) or a Next.js app (what v0 and create-next-app generate). Both deploy with the same commands; what differs is what runs online.

Vite: React, Vue, Svelte#

A Vite app builds to a folder of files (dist/). Skiffly runs npm run build and serves dist/ with a fast file server — no Node process, almost no memory, and on the Free plan it never sleeps.

npx skiffly login
npx skiffly init
npx skiffly up --yes
npx skiffly domain

Routes like /about or /dashboard/settings (React Router, Vue Router) work out of the box: unknown paths are answered with index.html so your router takes over.

Environment variables are read at build time and must start with VITE_:

npx skiffly variables set VITE_API_URL=https://api.example.com VITE_SUPABASE_URL=https://xxxx.supabase.co --skip-deploys
npx skiffly up

Everything in a VITE_ variable ends up in the browser — put only public keys there, never secrets.

Next.js#

Skiffly runs next build and starts next start. Server components, API routes, server actions and middleware all work — it is a real Node server.

npx skiffly login
npx skiffly init
npx skiffly up --yes
npx skiffly domain

Things to check in package.json:

{
  "scripts": {
    "build": "next build",
    "start": "next start"
  }
}

Keep "start": "next start" without -p 3000 — the platform tells Next.js the port through PORT.

Variables: NEXT_PUBLIC_* are baked in at build time (run npx skiffly up after changing them); server-only variables (database URL, API secrets) are read when the server starts.

Only static pages? If the site has no API routes or server code, add output: "export" to next.config — Skiffly then serves the exported files like a Vite app: cheaper, and it never sleeps on Free.

next.config.mjs
export default { output: "export", images: { unoptimized: true } };

From GitHub instead of your computer#

Push the project to GitHub, then in the dashboard: New project → New service → GitHub repo and pick it. The first deploy starts right away and every push to the branch deploys again. Set variables in the service Variables tab.

Adding a backend or a database later#

When the project grows a login or needs to store data, add it to the same project instead of gluing services together: New service → Template → PostgreSQL gives you a database and a DATABASE_URL your app can use. The full walk-through: Next.js + Postgres.

If the build fails#

Log saysFix
Module not found / Cannot find modulethe package is used but not in package.json: npm install <name>, then npx skiffly up
Type error: in Next.jsnext build checks types and next dev does not — fix the error (paste it into your assistant)
vite: not foundvite must be in devDependencies/dependencies, not only installed globally
the site shows Cannot GET / or a Node errorthe build output is not where expected — see Static sites for RAILPACK_SPA_OUTPUT_DIR

Next: connect your own domain.