now dev not serving serverless functions on Windows machine
See original GitHub issueI haven’t been able to get serverless functions to work using now dev
on my Windows machine.
Windows 10 node v10.16 yarn 1.19.1 now 16.3.1
I had tried a couple of different things with my own projects with no success so I turned to the example projects but I get the same results with them. I get the main app served from the default route (/
) as expected but any requests to /api/*
result in serving the content of the default route instead of what the function should return. Here are the basic steps I did and a screenshot of what I’m seeing when I visit the page.
These steps are identical to the repro from one of the now-examples issues: https://github.com/zeit/now-examples/issues/493
now init create-react-app-functions cra-fun
cd cra-fun
npm i
now dev

I’ve tried the above in a powershell terminal and also in an ubuntu WSL terminal running the same versions of node/yarn/now and I get the same behaviour. Does using nvm
/nvm-windows
have something to do with it? I’ve not had any other kind of issues using them.
I’ll note that if I deploy my projects using now
the serverless functions on the /api
routes work just fine. So it seems to just be something with now dev
(at least for my environment) and not a config issue or anything with the individual projects.
I’m not sure what else to try and I didn’t see anything in the other issues here or in the now-examples repo that got things working for me. Please let me know if there’s something in particular I should try or any other info I can provide to help investigate.
In case it helps, here is a screenshot of my terminal after running now dev -d

Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (4 by maintainers)
Right, so that’s actually exactly the issue. The
now dev
server is the one listening on port 3000. The CRA server (whichnow dev
boots up for the React frontend) is the randomized port.If you visit http://localhost:3000 instead, you should get the expected output from the
/api/date
endpoint.The issue here is basically that it’s confusing that two URLs are printed, so I don’t blame you for mixing up which is the correct one. We will have to think of a solution to make that less confusing.
Thanks for the explanation, it does work when I hit the address on port 3000. Makes me feel kinda dumb for not trying them both. I guess I just got too used to the CRA server being on 3000 and I figured the
now
server would be last since I saw something about waiting for ports in #2856 . I haven’t looked into how the builders work but I wonder if there’s a way to prefix or annotate the output of each builder. That might help clarify where messages come from. I can imagine it gets even more tricky with multiple builders.Anyway, this gets me past my issue so thank you for the help on that. Seems like there isn’t a real issue here.