#Port 3002 Specified, but Server Listening on 3000

1 messages · Page 1 of 1 (latest)

compact stratus
#

I'm encountering an issue where my server is listening on port 3000 despite explicitly setting port 3002 in my package.json start script:

"start": "remix-serve ./build/server/index.js --port 3002"

The server output shows:

[remix-serve] http://localhost:3000 (http://192.168.1.2:3000)

I've checked for environment variables and reviewed my server code, but can't find the cause. Any ideas on why this might be happening or how to troubleshoot further?

Thanks in advance!

manic juniper
#

I think port should be specified before the build

compact stratus
#

what do you mean? like below?

"scripts": {
"build": "remix vite:build --port 3003",
"dev": "remix vite:dev",
"lint": "eslint --ignore-path .gitignore --cache --cache-location ./node_modules/.cache/eslint .",
"start": "remix-serve ./build/server/index.js ",
"typecheck": "tsc"
},

#

it didn't work. nor did npm start --port 3003

manic juniper
#

Try it like "remix-serve --port 3001 ./build/server/index.js"

compact stratus
#

it results in below error

Error: ENOENT: no such file or directory, stat '/Users/un/Desktop/code/my-app/--port'

manic juniper
#

Well, now I don't know if the remix cli can change the server port from start command, maybe if it was a custom server and change the default port there

compact stratus
#

interesting that I don't have any remix config files or env ports that could set the port and take any precedence