GuidesTroubleshooting
The app exits immediately
The command of the instance ends without an error, but a web service must continue to run.
What you see
==> 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
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 is | Usual case | Repair |
|---|---|---|
| From the project, because the service has no start command | A library, or a site that only builds files. Its main file loads and returns. | Create the service as a static site with its build command and publish directory. Or set the start command of the server of the app. |
| The start command of the service | It only builds (npm run build). Or it starts a program in the background and returns. | Put the build steps in the build command. Start the server in the foreground. |
| The command of the image | An image for tasks that run one time | Set a start command on the service. |
A background worker that ends gets the same message. A task that runs and ends belongs in a cron job or a one-off job (ferry run).