These are the failures React2Static recognises on its own when a build breaks. Every entry below shows the real output npm, Vite or tsc prints, so you can search for the line you actually got — or drop your project into the builder and it will tell you which one you hit.
The package names, paths and sizes in the examples below are only examples — the builder fills in the ones from your own project.
What you see
error during build:
[vite]: Rollup failed to resolve import "react-router-dom" from "/home/project/src/App.tsx".
This is most likely unintended because it can break your application at runtime.The code imports react-router-dom, but it is not listed in package.json, so it was never installed. Add it to dependencies, or remove the import. This is the most common failure in AI-generated projects — it works on the machine that wrote it because the package is already there.
The fix
npm install react-router-domWhat you see
npm error Missing script: "build"
npm error
npm error To see a list of scripts, run:
npm error npm runWe run npm run build, and there is nothing to run. Add a build script — for a Vite project that is "build": "vite build".
The fix
{
"scripts": {
"build": "vite build"
}
}What you see
src/components/PostCard.tsx:12:23 - error TS2339: Property 'title' does not exist on type 'Post'.
12 <h2>{post.title}</h2>
~~~~~The build script runs tsc before bundling and type checking failed. Fix the file named in the log, or change the build script to run the bundler only — "vite build" instead of "tsc && vite build".
The fix
{
"scripts": {
"build": "vite build"
}
}What you see
> [email protected] build
> vite build
sh: 1: vite: not foundThe build script calls vite, but it is not in package.json, so it never got installed. Add it to devDependencies.
The fix
npm install -D viteWhat you see
npm error code ERESOLVE
npm error ERESOLVE unable to resolve dependency tree
npm error
npm error While resolving: [email protected]
npm error Found: [email protected]Two packages want incompatible versions of the same dependency. We already retried the install with --legacy-peer-deps and it still failed, so the versions in package.json have to be reconciled by hand.
What you see
npm error code E404
npm error 404 Not Found - GET https://registry.npmjs.org/@shadcn%2fui-toast
npm error 404 '@shadcn/ui-toast@^1.0.0' is not in this registry.npm cannot find it in the registry. AI tools sometimes invent package names, and private packages are not reachable from here. Check the spelling in package.json, or drop the dependency if nothing imports it.
What you see
npm error code ETARGET
npm error notarget No matching version found for react@^19.9.0.The package exists but that version range does not. Loosen the range in package.json, or pin it to a version that was actually published.
What you see
vite v5.4.10 building for production...
✓ 41 modules transformed.
✓ built in 1.24sThe build itself finished without errors, but there is nothing to collect. We look in dist/, build/ and out/ — check which directory your build config writes to.
What you see
▲ Next.js 14.2.5
✓ Compiled successfully
✓ Generating static pages (5/5)
Route (app) Size First Load JSBy default next build writes a server application to .next/. Add output: "export" to next.config.js and build again — that writes plain files to out/, which we can pick up. Server-side features (API routes, server actions, image optimisation) do not survive the export.
The fix
// next.config.js
module.exports = {
output: 'export',
}What you see
<--- Last few GCs --->
FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memoryA build inside the browser gets a limited amount of memory, and this project went past it. Removing unused dependencies and oversized assets usually brings it back under; otherwise this one has to be built on your own machine.
What you see
npm error code EUNSUPPORTEDPROTOCOL
npm error Unsupported URL Type "workspace:": workspace:*package.json uses workspace: dependencies, which only resolve inside the full repository. Upload just the app itself, with real version numbers in place of the workspace: references.
What you see
npm warn EBADENGINE Unsupported engine {
npm warn EBADENGINE package: '[email protected]',
npm warn EBADENGINE required: { node: '>=22.0.0' },
npm warn EBADENGINE current: { node: 'v20.11.1' }
npm warn EBADENGINE }A dependency declares a Node version this environment does not provide. Relax the engines field, or move to a release of that package which supports current Node.
What you see
npm error code EAI_AGAIN
npm error network request to https://registry.npmjs.org/react failed, reason: getaddrinfo EAI_AGAIN registry.npmjs.orgThe download broke off partway. This is usually temporary — just retry the build. Where registry.npmjs.org is blocked you will need a VPN.
Drop your ZIP into the builder. It runs the real build in your browser, and when something breaks it points at the line that matters instead of handing you the whole log.
Open the builder