Skip to content

Never ending "Waiting for framework" in 19.0.3 #7124

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Simbul opened this issue Mar 22, 2025 · 11 comments · Fixed by #7135 or #7242
Closed

Never ending "Waiting for framework" in 19.0.3 #7124

Simbul opened this issue Mar 22, 2025 · 11 comments · Fixed by #7135 or #7242
Assignees
Labels
status: missing info/reproduction type: bug code to address defects in shipped code

Comments

@Simbul
Copy link

Simbul commented Mar 22, 2025

Describe the bug

Since upgrading to 19.0.3, netlify dev is constantly showing the following message, with a spinner on the left:

⠦ Waiting for framework port 5173. This can be configured using the 'targetPort' property in the netlify.toml

Running the same command with 19.0.2 does not result in the same behaviour. In fact, the wait seems to be over pretty quickly:

✔ Waiting for framework port 5173. This can be configured using the 'targetPort' property in the netlify.toml

This is printed out before the message saying Server now ready on http://localhost:8888

Steps to reproduce

  1. Start in the root of my repo (apologies, this is a private project)
  2. Upgrade netlify-cli to 19.0.3
  3. Run netlify dev
  4. Everything seems to be working fine, but the CLI keeps "waiting for framework port 5173"

Configuration

[build]
command = "react-router build"
publish = "build/client"

[dev]
command = "react-router dev"

Environment

  System:
    OS: macOS 15.3.2
    CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 3.13 GB / 32.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 23.10.0 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 10.9.2 - /usr/local/bin/npm
  npmGlobalPackages:
    netlify-cli: 19.0.3
@Simbul Simbul added the type: bug code to address defects in shipped code label Mar 22, 2025
@ffaubert
Copy link

I'm having the same issue, had to downgrade back to 19.0.2

@serhalp serhalp added the status: triage Issues that need to be combed over label Mar 24, 2025
@ndhoule
Copy link
Contributor

ndhoule commented Mar 24, 2025

@Simbul @ffaubert I'm unable to reproduce this myself, but I can definitely investigate more if either of you can put together a minimal reproducible example! Doesn't need to be your full app, just enough to consistently trigger this behavior.

@serhalp serhalp added status: missing info/reproduction and removed status: triage Issues that need to be combed over labels Mar 24, 2025
@ffaubert
Copy link

@ndhoule It seems to be an issue with netlify and vite. I put together a very simplistic test case at https://github.com/ffaubert/netlify-cli-test.

To reproduce after npm install, run netlify dev and then make a change to public/index.html and you'll see
⠋ Waiting for framework port 5173. This can be configured using the 'targetPort' property in the netlify.toml
forever.

Also new in v19.0.3 at startup I see:
MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 SIGINT listeners added to [process]. MaxListeners is 10. Use emitter.setMaxListeners() to increase limit
(Use node --trace-warnings ... to show where the warning was created)
(node:61086) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 SIGTERM listeners added to [process]. MaxListeners is 10. Use emitter.setMaxListeners() to increase limit

That was not there in 19.0.2

Thank you for investigating this!

@ndhoule
Copy link
Contributor

ndhoule commented Mar 25, 2025

@ffaubert Thanks for the repro! I'm seeing the EventEmitter warning, but I'm not able to reproduce the behavior. I'm on Linux, which might explain the difference; I'll pair up with a coworker who runs macOS to see if this is a platform-specific issue.

I'll keep you both posted--thanks for your patience in the meantime.

@serhalp
Copy link
Collaborator

serhalp commented Mar 25, 2025

@Simbul @ffaubert I think I may have a fix for this in #7135. Could you give it a try and let me know if it's fixed?

(Note that this won't fix the MaxListenersExceededWarning, just the hanging netlify dev)

@Simbul
Copy link
Author

Simbul commented Mar 25, 2025

Thank you @serhalp. Unfortunately, I'm still seeing the same behaviour on the version you specified

$ netlify version
netlify-cli/19.0.3-pre.9266a2d darwin-x64 node-v23.10.0

When using netlify dev, the message ⠹ Waiting for framework port 5173. This can be configured using the 'targetPort' property in the netlify.toml is always printed as the last line of the server output (i.e. the same behaviour from my initial post).

@serhalp serhalp reopened this Mar 26, 2025
@Simbul
Copy link
Author

Simbul commented Apr 6, 2025

To add more data: I'm still seeing the same behaviour on netlify-cli/19.1.5 darwin-x64 node-v23.10.0.

@Simbul
Copy link
Author

Simbul commented Apr 14, 2025

Also, still there in 20.0.0.

@Florian-Mt
Copy link
Contributor

Florian-Mt commented Apr 28, 2025

It looks like if (spinner.isSpinning) (here: /src/utils/shell.ts#L64) is missing call parentheses, as isSpinning is a function (see : usmanyunusov/nanospinner:/src/index.ts#L183).
So the condition is always true. I bet that it was not intentional.
It seems better after adding parens.

@serhalp
Copy link
Collaborator

serhalp commented Apr 28, 2025

Thanks for spotting that @Florian-Mt — that's an embarrassing one!

I'll prepare a fix. For some reason I can actually finally repro this issue now, so I'll be able to confirm the fix.

serhalp added a commit that referenced this issue Apr 28, 2025
See:
1. #7026
2. #7131
3. #7124

Oops, I was really overthinking this. All this needs to do is, every time a chunk comes in
from the underlying framework dev server, clear the spinner line, write the chunk, then
resume the spinner.

This wasn't set up right at all, which was obfuscated by the erroneous use of `isSpinning`
(see previous commit).
serhalp added a commit that referenced this issue Apr 29, 2025
See:
1. #7026
2. #7131
3. #7124

Oops, I was really overthinking this. All this needs to do is, every time a chunk comes in
from the underlying framework dev server, clear the spinner line, write the chunk, then
resume the spinner.

This wasn't set up right at all, which was obfuscated by the erroneous use of `isSpinning`
(see previous commit).
@serhalp serhalp self-assigned this Apr 29, 2025
serhalp added a commit that referenced this issue May 1, 2025
See:
1. #7026
2. #7131
3. #7124

Oops, I was really overthinking this. All this needs to do is, every time a chunk comes in
from the underlying framework dev server, clear the spinner line, write the chunk, then
resume the spinner.

This wasn't set up right at all, which was obfuscated by the erroneous use of `isSpinning`
(see previous commit).
serhalp added a commit that referenced this issue May 1, 2025
See:
1. #7026
2. #7131
3. #7124

Oops, I was really overthinking this. All this needs to do is, every time a chunk comes in
from the underlying framework dev server, clear the spinner line, write the chunk, then
resume the spinner.

This wasn't set up right at all, which was obfuscated by the erroneous use of `isSpinning`
(see previous commit).
serhalp added a commit that referenced this issue May 1, 2025
…t") (#7242)

* fix: fix framework server loading spinner rendering

This is a regression in the loading spinner shown before "Waiting for framework port", introduced in 19.0.3.

* fix: fix framework server spinner

See:
1. #7026
2. #7131
3. #7124

Oops, I was really overthinking this. All this needs to do is, every time a chunk comes in
from the underlying framework dev server, clear the spinner line, write the chunk, then
resume the spinner.

This wasn't set up right at all, which was obfuscated by the erroneous use of `isSpinning`
(see previous commit).
serhalp added a commit that referenced this issue May 1, 2025
* fix: fix framework server loading spinner rendering

This is a regression in the loading spinner shown before "Waiting for framework port", introduced in 19.0.3.

* fix: fix framework server spinner

See:
1. #7026
2. #7131
3. #7124

Oops, I was really overthinking this. All this needs to do is, every time a chunk comes in
from the underlying framework dev server, clear the spinner line, write the chunk, then
resume the spinner.

This wasn't set up right at all, which was obfuscated by the erroneous use of `isSpinning`
(see previous commit).

* fix: remove "Netlify Dev" prefix from deploy log

* fix(dev): polish and improve dev command

- Reworded messages for clarity and consistency
  - I think "Netlify Dev" was a vestige of Netlify CLI's predecessor...? In any case, I
    dropped this wording.
  - e.g. Starting Netlify Dev with Astro → Starting Astro dev server
  - e.g. Waiting for framework port 4321 → Waiting for Astro dev server to be ready on port 4321
- Removed the "🔸 Netlify Dev 🔸" first line (doesn't seem to add anything)
- Attempted to address the common confusion around the two printed URLs (our dev server +
  framework server):
  - more distinctive box
  - 'inverted' colour on the URL (cyan background) to make it stand out the most
  - changed `Server now ready on http...` to `Local dev server ready: http...`
- Attempted to address the common confusion around this message: `✔ Waiting for framework
  port 4321. This can be configured using the 'targetPort' property in the netlify.toml`
  - (Users often think this is an error message. I don't blame them.)
  - I changed this to `Waiting for Astro dev server to be ready on port 4321` (where Astro is the framework name)
  - I added logic so that after 5 seconds of waiting the message changes to `Still waiting
    for server on port 4321 to be ready. Are you sure this is the correct port for your
    Astro site? Change this with the targetPort option in your netlify.toml.`.
- Collapse "Injected env var" messages into a single line per source
- ◈ → ⬥

* fix: revert the framework server log prefix for now
@serhalp
Copy link
Collaborator

serhalp commented May 6, 2025

Hey folks, this should be finally fixed in 21.0.0. Thanks for bearing with us!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: missing info/reproduction type: bug code to address defects in shipped code
Projects
None yet
5 participants