Site Name: https://google-cal-event-page.netlify.app
Expected behavior: Local dev server ready at port 8888 every time I run netlify dev
Current behavior: Only occasionally, I get the message that the local server is ready at port 8888
I will very occasionally get this full response:
When that happens, the dev sever opens up automatically using port 8888 (as Iβm used to it doing) and I can open the function using port 8888.
About 90% of the time, Iβm getting this message.
(in other words, no message that local 8888 is ready). In those instances, port 8888 will not work for my functions and I have to manually type the Functions server is listening port #. Even then, Iβm unable to access my local functions in dev without cors errors and other trouble with client-side code when port 8888 doesnβt work properly.
Iβve used serverless functions for months without any trouble across multiple different sites without any trouble. Any help you can give would be a big help. Thanks!
A few things Iβve tried:
I do have two netlify accounts. Iβve ensured Iβm logged out of both and then log back in with the netlify CLI to the correct account
Iβve unlinked and relinked the site
Iβve completely uninstalled/reinstalled netlify-cli globally and in my local dir
Iβve restarted my machine (usually when I do that, it will show the local port the first time I run netlify dev
.
Iβve tried to declare a port in the command netlify dev -p 8888
and by declaring [dev] with instructions in the netlify.toml file
Hi @cpenned
What version of Node are you using? There is an open issue with regards ntl dev
and v17
opened 01:07PM - 10 Nov 21 UTC
closed 09:20AM - 19 Jul 22 UTC
medium priority
type: bug
area: command: dev
**Describe the bug**
Similar to this: https://github.com/netlify/cli/issues/2β¦ 882#issue-939909811
Netlify Dev tries to start a server, it injects the environment variables, parses the configuration files and starts the local server of the framework, however it never starts the Netlify CLI's server.
Till now, the behaviour has been observed with Vite and Create React App (but more frameworks could be affected). This has been observed on MacOS 12. Other Operating Systems have not been checked.
This works with Node `14.17.5`, possibly with any other Node version than Node 17.
**To Reproduce:**
1. Use Node 17 (17.0.1 at the time of writing).
1. Try running `netlify dev` in a project (possibly in a Vite or CRA project)
1. See that the dev server never starts.
**Configuration**
```bash
System:
OS: macOS 12.0.1
CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
Memory: 891.31 MB / 16.00 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 17.0.1 - ~/.nvm/versions/node/v17.0.1/bin/node
npm: 8.1.1 - ~/.nvm/versions/node/v17.0.1/bin/npm
```
**Expected behaviour**
The Netlify Dev server should start.
**CLI Output**
Vite:
```
β Netlify Dev β
β Ignored general context env var: LANG (defined in process)
β Starting Netlify Dev with vite
> dev
> vite
vite v2.4.1 dev server running at:
> Local: http://localhost:3000/
> Network: use `--host` to expose
ready in 217ms.
```
**Additional context**
Marked `low-priority` as there's a workaround to use a different Node version.
There is also another open issue regards Vite that is possibly relevant in this instance
opened 04:41AM - 14 Dec 21 UTC
type: bug
**Describe the bug**
When starting multiple dev servers, vite switches to ano⦠ther port but the netlify cli keeps using the old one.
**To Reproduce**
Steps to reproduce the behavior:
1. Start 2 terminals (all steps below for both `app-a` and `app-b`)
2. Run `npm init vite@latest app-a --template vanilla`
3. Navigate to the folder and `npm install`
4. Add some unique html (e.g. `<p>App A</p>`) to distinguish them
5. Run `netlify dev`
6. Open the localhost netlify server URL and see that they both show the same website.
**Configuration**
- If possible, please copy/paste below your `netlify.toml`.
None used
- Please enter the following command in a terminal and copy/paste its output:
```bash
npx envinfo --system --binaries --npmPackages netlify-cli --npmGlobalPackages netlify-cli
```
```
System:
OS: Linux 5.15 Manjaro Linux
CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
Memory: 1.18 GB / 15.51 GB
Container: Yes
Shell: 5.8 - /usr/bin/zsh
Binaries:
Node: 16.13.0 - ~/.nvm/versions/node/v16.13.0/bin/node
Yarn: 1.22.17 - /usr/bin/yarn
npm: 8.3.0 - ~/.nvm/versions/node/v16.13.0/bin/npm
npmGlobalPackages:
netlify-cli: 8.1.1
```
**Expected behavior**
The second dev server should load the app-b website at localhost:3001
**CLI Output**
App A:
```
> app-a@0.0.0 netlify
> netlify dev
β Netlify Dev β
β Ignored general context env var: LANG (defined in process)
β Ignored general context env var: LANGUAGE (defined in process)
β Starting Netlify Dev with Vite
> app-a@0.0.0 dev
> vite
vite v2.7.2 dev server running at:
> Local: http://localhost:3000/
> Network: use `--host` to expose
ready in 156ms.
βββββββββββββββββββββββββββββββββββββββββββββββββββ
β β
β β Server now ready on http://localhost:8888 β
β β
βββββββββββββββββββββββββββββββββββββββββββββββββββ
```
localhost:8888 correctly shows `App A`
App B:
```
> app-b@0.0.0 netlify
> netlify dev
β Netlify Dev β
β Ignored general context env var: LANG (defined in process)
β Ignored general context env var: LANGUAGE (defined in process)
β Starting Netlify Dev with Vite
ββββββββββββββββββββββββββββββββββββββββββββββββββββ
β β
β β Server now ready on http://localhost:36821 β
β β
ββββββββββββββββββββββββββββββββββββββββββββββββββββ
> app-b@0.0.0 dev
> vite
Port 3000 is in use, trying another one...
vite v2.7.2 dev server running at:
> Local: http://localhost:3001/
> Network: use `--host` to expose
ready in 166ms.
```
localhost:36821 also shows `App A` instead of `B`
**Additional context**
4 Likes
cpenned
February 8, 2022, 10:31pm
3
Ah! that was it. Down graded to 16.3 and it worked like a charm. Thanks!
2 Likes