stackapRequest access

Frameworks

React on Stackap

A React app runs on Stackap as a static single-page app when it is built with Vite or Create React App, and as a server when it is built with Next.js; React itself is not what Stackap detects.

How Stackap recognizes React

Stackap never looks for react in your dependencies. It looks at the tool that builds the app. If that tool is Vite, Create React App (react-scripts), Vue CLI or Parcel, with a build script and no server-rendering framework, the app is served as static files. If the app depends on next, it is a Next.js app. Anything else with a start script runs as a plain Node app.

What Stackap builds

For a React single-page app the generated image runs your build, then copies the first of the usual output folders that contains an index.html. A Vite app writes to dist and a Create React App project writes to build; both are on the list. If none contains an index.html, the build stops with a message naming the folders it looked in.

The web server in front of the files sends every path that is not a real file to index.html, so a client-side router such as React Router can handle a deep link like /account/settings opened directly or refreshed.

Create React App is no longer recommended for new projects by the React team, and its build tooling is old, so a new app is better started on Vite. Existing Create React App projects build and are served the same way.

What a React project needs

Verification status

The single-page-app path has a real Docker build in the platform's test suite, including the index.html fallback.

Still to verify: React Server Components, streaming server rendering, or any React framework with its own server runtime other than Next.js. Those need a server, and the static path will not run one.

Early-access scope

Questions

Do I need Next.js to host React?
No. A plain React single-page app builds and runs as static files. Next.js adds a server, which Stackap also supports separately.
Why is my environment variable undefined?
It lacked the public prefix, so the build tool did not include it. Add VITE_ or REACT_APP_, and remember it is then readable by every visitor.

Stackap is in early access. Tell us what you run and we will reply with a straight answer about whether it fits.

Ask for an invitation

Last updated .