Node Start scripts keeps re-running once completed

I want to deploy an api with render, my build steps works fine, but the yarn start scripts keeps looping over here is the logs

Jun 28 02:58:44 PM  ==> Docs on specifying a Node version: https://render.com/docs/node-version
Jun 28 02:58:44 PM  ==> Starting service with 'node .output/server/index.mjs'
Jun 28 02:59:17 PM  ==> Using Node version 20.3.1 via /opt/render/project/src/package.json
Jun 28 02:59:17 PM  ==> Docs on specifying a Node version: https://render.com/docs/node-version
Jun 28 02:59:17 PM  ==> Starting service with 'node .output/server/index.mjs'
Jun 28 02:59:55 PM  ==> Using Node version 20.3.1 via /opt/render/project/src/package.json
Jun 28 02:59:55 PM  ==> Docs on specifying a Node version: https://render.com/docs/node-version
Jun 28 02:59:55 PM  ==> Starting service with 'node .output/server/index.mjs'
Jun 28 03:00:54 PM  ==> Using Node version 20.3.1 via /opt/render/project/src/package.json
Jun 28 03:00:54 PM  ==> Docs on specifying a Node version: https://render.com/docs/node-version
Jun 28 03:00:54 PM  ==> Starting service with 'node .output/server/index.mjs'
Jun 28 03:02:26 PM  ==> Using Node version 20.3.1 via /opt/render/project/src/package.json
Jun 28 03:02:26 PM  ==> Docs on specifying a Node version: https://render.com/docs/node-version
Jun 28 03:02:26 PM  ==> Starting service with 'node .output/server/index.mjs'

here is my package json

{
  "private": true,
  "scripts": {
    "dev": "npx nitropack dev",
    "build": "npx nitropack build",
    "donothing": "echo \"Error: no test specified\" && exit 1",
    "preview": "node .output/server/index.mjs",
    "start": "node .output/server/index.mjs",
    "push": " drizzle-kit push:mysql"
  },
  "dependencies": {
    "@planetscale/database": "^1.7.0",
    "bcrypt": "^5.1.0",
    "dotenv": "^16.3.1",
    "drizzle-orm": "^0.27.0",
    "jsonwebtoken": "^9.0.0",
    "nitropack": "latest",
    "zod": "^3.21.4"
  },
  "devDependencies": {
    "@types/bcrypt": "^5.0.0",
    "@types/jsonwebtoken": "^9.0.2",
    "drizzle-kit": "^0.19.2"
  },
  "engines": {
    "node": ">=16.0.0"
  }
}

Hi Chigbata,

Could you confirm you’ve configured your host and port per this documentation: https://render.com/docs/web-services#host-and-port-configuration

If that doesn’t help could you paste the contents of your index.mjs file?

Regards,

Matt

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.