3000 / 8888 Port Conflict with Netlify Dev and Nextauth on Localhost

Hi. Appreciate the reply but would like this solving its causing a lot of grief as I need next-auth running simultaneously on localhost with netlify dev.

In this post in July 2021 Dev environment starting servers on both :3000 and :8888

You stated

" That’s how it works! :3000 is the one started by your SSG. :8888 is the one started by Netlify Dev. Netlify-specific features like Functions won’t work on :3000 ."

This seems to align with the issue I have, eg I would like to have netlify functions working together with Netlify Dev on the same port.

Is this feasible?

RE your questions my set up is:

netlify --version
netlify-cli/15.5.0 darwin-x64 node-v18.16.0

Here is my log when running Netlify Dev:

  • Executing task: netlify dev
◈ Netlify Dev ◈
◈ Ignored general context env var: LANG (defined in process)
◈ Injected .env.local file env var: FAUNADB_SERVER_SECRET
◈ Injected .env.local file env var: NEXTAUTH_URL
◈ Injected .env.local file env var: NEXTAUTH_SECRET
◈ Injected .env.local file env var: FACEBOOK_CLIENT_ID
◈ Injected .env.local file env var: FACEBOOK_CLIENT_SECRET
◈ Setting up local development server
◈ Starting Netlify Dev with Next.js

> nameofmysite@2.0.0 dev
> next dev

- ready started server on 0.0.0.0:3000, url: http://localhost:3000
✔ Waiting for framework port 3000. This can be configured using the 'targetPort' property in the netlify.toml
◈ Loaded function function1 http://localhost:8888/.netlify/functions/function1.
◈ Loaded function function2 http://localhost:8888/.netlify/functions/function2.
◈ Functions server is listening on 56323
- info Loaded env from (mypath)-nextjs/.env.local

   ┌─────────────────────────────────────────────────┐
   │                                                 │
   │   ◈ Server now ready on http://localhost:8888   │
   │                                                 │
   └─────────────────────────────────────────────────┘

◈ Loaded edge function netlify dev handler
- event compiled client and server successfully in 204 ms (18 modules)
- wait compiling / (client and server)...
- wait compiling /api/auth/[...nextauth] (client and server)...
- wait compiling /_error (client and server)...
- event compiled client and server successfully in 721 ms (422 modules)
- warn Fast Refresh had to perform a full reload. Read more: https://nextjs.org/docs/messages/fast-refresh-reload
DEBUG_ENABLED 0 [ 'DEBUG_ENABLED' ]