cli icon indicating copy to clipboard operation
cli copied to clipboard

functions are running on different port while frontend is running on another port

Open saswatsam786 opened this issue 2 years ago • 4 comments

Describe the bug Netlify functions are not running on port 8888, the functions are listening on some random port 60248 which is causing error in running locally A clear and concise description of what the bug is.

To Reproduce

Steps to reproduce the behavior:

  1. Run git clone [email protected]:owner/repo-with-cli-bug.git
  2. Navigate to the cloned repository
  3. Run netlify dev
  4. See that the CLI exits with an error

Configuration

  • If possible, please copy/paste below your netlify.toml.
  • Please enter the following command in a terminal and copy/paste its output:
npx envinfo --system --binaries --npmPackages netlify-cli --npmGlobalPackages netlify-cli

Expected behavior

A clear and concise description of what you expected to happen.

CLI Output

If applicable, add the CLI output to help explain your problem.

Additional context

Add any other context about the problem here. Screenshot 2022-01-22 at 2 21 41 AM

saswatsam786 avatar Jan 21 '22 20:01 saswatsam786

@croaky

saswatsam786 avatar Jan 21 '22 20:01 saswatsam786

Hi @saswatsam786, can you fill in the missing parts from the issue template? Specifically To Reproduce, Configuration and Expected behavior.

Running the functions server on a different port is the expected behavior. Can you describe what issue it's causing for you?

erezrokah avatar Jan 24 '22 09:01 erezrokah

Actually, the function addData is not working on (http://localhost:8888/.netlify/functions/addData) as specified but it is working on port 60248.

saswatsam786 avatar Jan 24 '22 22:01 saswatsam786

Thanks @saswatsam786, can you share a reproduction scenario that reproduces the "not working on port 8888" and "working on port 60248".

The function should work on port 8888, so it would be great to understand the reason it doesn't

erezrokah avatar Jan 25 '22 10:01 erezrokah

Is there some news about this problem? One year later and I have the exact same problem, functions are listening on some random port wich I can't call from my frontend. :(

shryme avatar Apr 11 '23 00:04 shryme

Same problem here ... functions are running in a random port every time

luisjuarros avatar May 24 '23 09:05 luisjuarros

I had Netlify CLI installed globally, I just tried installing it locally and it works!

npm install --save-dev netlify-cli

It may be worth it to try installing it locally if you're still experiencing issue like me!

shryme avatar Jul 27 '23 03:07 shryme