FerryDocs

The app exits immediately

The command of the instance ends without an error, but a web service must continue to run.

Edit on GitHub

What you see

Deploy log
==> Start command: node ./dist/index.js (package.json has no "start" script: its "main" file is run)
…
==> Deploy failed: instance 2e58a7 exited with code 0: its command `node ./dist/index.js` ended without an error, but a web service must keep running and listen on port 10000
==> Hint: the service has no start command, so Ferry picked this one from the project (see "==> Start command" in the build log). If the project is an app, set the start command that runs its server. If it only builds files (a static site, a component library), create it as a static site instead.

Why it occurs

Commandof the instanceInstancelistens

A server command continues to run and listens on the port.

1 / 2

The command ended without an error, and frequently printed nothing. It did not start a server. The message names the command. The hint tells where the command comes from.

How to repair it

The command isUsual caseRepair
From the project, because the service has no A library, or a site that only builds files. Its main file loads and returns.Create the service as a static site with its and . Or set the start command of the server of the app.
The start command of the serviceIt only builds (npm run build). Or it starts a program in the and returns.Put the build steps in the build command. Start the server in the .
The command of the imageAn image for tasks that run one timeSet a start command on the service.

A that ends gets the same message. A task that runs and ends belongs in a cron job or a one-off job (ferry run).

On this page