refinedev/refine · warning
Refine will use `./build/index.js` as default
Error message
Refine will use `./build/index.js` as default
What it means
This is a console.warn emitted by the Refine CLI's `refine start` command when running a Remix project. Remix does not expose a conventional entry file that the runner can infer, so if no path argument is given in the package.json script, the CLI falls back to `./build/index.js` and warns about it. It is informational: the process still starts, just against an assumed default that may not exist.
Source
Thrown at packages/cli/src/commands/runner/projectScripts.ts:72
getBin: () => resolveBin("next"),
},
[ProjectTypes.REMIX]: {
getDev: (args: string[]) => ["dev", ...args],
getStart: (args: string[]) => {
// remix-serve accepts a path to the entry file as an argument
// if we have arguments, we will pass them to remix-serve and do nothing.
// ex: `refine start ./build/index.js`
const hasArgs = args?.length;
if (hasArgs) {
return args;
}
// otherwise print a warning and use `./build/index.js` as default
console.log();
console.warn(
"🚨 Remix requires a path to the entry file. Please provide it as an argument to `refine start` command in package.json scripts",
);
console.warn("Refine will use `./build/index.js` as default");
console.warn("Example: `refine start ./build/index.js`");
console.log();
return ["./build/index.js"];
},
getBuild: (args: string[]) => ["build", ...args],
getBin: (type?: "dev" | "start" | "build") => {
return resolveBin(type === "start" ? "remix-serve" : "remix");
},
},
[ProjectTypes.REMIX_VITE]: {
getDev: (args: string[]) => ["vite:dev", ...args],
getStart: (args: string[]) => {
// remix-serve accepts a path to the entry file as an argument
// if we have arguments, we will pass them to remix-serve and do nothing.
// ex: `refine start ./build/server/index.js`
const hasArgs = args?.length;
if (hasArgs) {View on GitHub (pinned to 779d52a20e)
Solutions
- Edit package.json and change `"start": "refine start"` to `"start": "refine start ./build/index.js"`
- Verify the built entry file actually exists at ./build/index.js after running `refine build` (or `remix build`)
- If your build outputs elsewhere (e.g. ./build/server/index.js), pass that path instead
Example fix
// before "start": "refine start" // after "start": "refine start ./build/index.js"
Defensive patterns
Strategy: validation
Validate before calling
// before start: assert the entry exists
import { existsSync } from 'node:fs';
if (!existsSync('./build/index.js')) {
console.error('Build output missing — run `refine build` first');
process.exit(1);
} Prevention
- Always author start scripts with an explicit entry path instead of relying on CLI defaults
- Add a CI step that verifies the configured entry file exists after build
When it happens
Trigger: Running `refine start` (or `refine dev`/`refine build` via the runner) in a Remix project whose package.json script is exactly `refine start` with no positional entry-file argument (i.e., `hasArgs` is false for the classic Remix preset).
Common situations: Scaffolding a Remix app with the Refine CLI and forgetting to append the server entry path to the start script; projects migrated from other presets (Vite/Next) where an entry argument was never needed; older refine CLI versions that didn't require it.
Related errors
- Example: `refine start ./build/index.js`
- Refine will use `./build/server/index.js` as default
- Example: `refine start ./build/server/index.js`
- Invalid provider: ${providerId}
- Timed out while checking for updates.
AI-assisted analysis of refinedev/refine@779d52a20e (2026-08-27).
Data as JSON: /api/errors/f9de31dbb5a67e0a.
Report an issue: GitHub.