Skip to content
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

🐛 BUG: pages dev output is unnecessarily verbose #4265

Closed
Cherry opened this issue Oct 23, 2023 · 7 comments · Fixed by #5927
Closed

🐛 BUG: pages dev output is unnecessarily verbose #4265

Cherry opened this issue Oct 23, 2023 · 7 comments · Fixed by #5927
Assignees
Labels
bug Something that isn't working pages Relating to Pages pages-dev Relating to `pages dev` command

Comments

@Cherry
Copy link
Contributor

Cherry commented Oct 23, 2023

Which Cloudflare product(s) does this pertain to?

Pages, Wrangler core

What version(s) of the tool(s) are you using?

3.14.0

What version of Node are you using?

18.18.0

What operating system are you using?

Windows

Describe the Bug

When running npx wrangler pages dev <dir>, you get a LOT of verbose output:

image

> npx wrangler pages dev ./dist

▲ [WARNING] No compatibility_date was specified. Using today's date: 2023-10-23.

  Pass it in your terminal:
  \`\`\`
  --compatibility-date=2023-10-23
  \`\`\`
  See https://developers.cloudflare.com/workers/platform/compatibility-dates/ for more information.


Compiling worker to "C:\Users\james\AppData\Local\Temp\functionsWorker-0.005178014829587907.mjs"...
✨ Compiled Worker successfully
 ⛅️ wrangler 3.14.0
-------------------
▲ [WARNING] --local is no longer required and will be removed in a future version.

  `wrangler dev` now uses the local Cloudflare Workers runtime by default. 🎉


⎔ Starting local server...
▲ [WARNING] Parsed 5 valid header rules.


[mf:wrn] The latest compatibility date supported by the installed Cloudflare Workers Runtime is "2023-10-16",
but you've requested "2023-10-23". Falling back to "2023-10-16"...
kj/async-io-win32.c++:982: warning: Bind address resolved to multiple addresses.  Only the first address will be used.  If this is incorrect, specify the address numerically.  This may be fixed in the future.; addrs[0].toString() = 127.0.0.1:59452
[mf:inf] Ready on http://0.0.0.0:8788
[mf:inf] - http://172.22.208.1:8788
[mf:inf] - http://192.168.50.240:8788
[mf:inf] - http://127.0.0.1:8788

That's a lot of visual noise to try and scan and determine if my command was successful or not.

This is without any wrangler.toml in my directory.

Actionable things I'd recommend:

@Cherry Cherry added the bug Something that isn't working label Oct 23, 2023
@github-project-automation github-project-automation bot moved this to Untriaged in workers-sdk Oct 23, 2023
@lrapoport-cf lrapoport-cf moved this from Untriaged to Backlog in workers-sdk Nov 8, 2023
@klaemo
Copy link

klaemo commented Nov 9, 2023

I can confirm this and it's still like that in 3.15.0

npx wrangler pages dev dist                                
▲ [WARNING] No compatibility_date was specified. Using today's date: 2023-11-09.

  Pass it in your terminal:
  \```
  --compatibility-date=2023-11-09
  \```
  See https://developers.cloudflare.com/workers/platform/compatibility-dates/ for more
  information.


Compiling worker to "/Users/clemens/Projects/webapp/.wrangler/tmp/pages-10DKtg/functionsWorker-0.21075951104789326.mjs"...
✨ Compiled Worker successfully
 ⛅️ wrangler 3.15.0
-------------------
▲ [WARNING] --local is no longer required and will be removed in a future version.

  `wrangler dev` now uses the local Cloudflare Workers runtime by default. 🎉


Using vars defined in .dev.vars
Your worker has access to the following bindings:
- Vars:
  - API_URL: "(hidden)"
⎔ Starting local server...
▲ [WARNING] Parsed 1 valid redirect rule.


▲ [WARNING] Parsed 3 valid header rules.

There are just way too many warnings for a successful operation

  • the compatibility-date warning is confusing. If I'm required to pass this, why is it an optional flag?
  • the warning about --local is just plain wrong, because I didn't pass that flag
  • the warnings about valid header and redirect rules prompted me to check if I did something wrong...but apparently not

I think a one liner log message for the successful start of the local server would be sufficient. Something like:

Started local server on http://0.0.0.0:8788 with 1 redirect rule, 3 header rules and compatibility-date=2023-11-09.

or if you want to to be slightly more verbose:

Local server listing on http://0.0.0.0:8788
- detected 1 redirect rule
- detected 3 header rules
- using compatibility date "2023-11-09"

magnusdahlstrand added a commit to magnusdahlstrand/workers-sdk that referenced this issue Jan 23, 2024
magnusdahlstrand added a commit to magnusdahlstrand/workers-sdk that referenced this issue Jan 23, 2024
magnusdahlstrand added a commit to magnusdahlstrand/workers-sdk that referenced this issue Jan 23, 2024
magnusdahlstrand added a commit to magnusdahlstrand/workers-sdk that referenced this issue Jan 23, 2024
petebacondarwin added a commit that referenced this issue Jan 29, 2024
)

* [wranger] fix: createMetadataObject to use logging levels (#4265)

* Update .changeset/wet-lemons-wash.md

Update changeset to be more user focussed

Co-authored-by: Pete Bacon Darwin <pete@bacondarwin.com>

---------

Co-authored-by: Pete Bacon Darwin <pete@bacondarwin.com>
@newsve
Copy link

newsve commented Mar 20, 2024

It gets worse if you use something like Vite, then you see thousands of urls on every request to the dev servers and can't catch any of our own console.logs anymore

@CarmenPopoviciu
Copy link
Contributor

triaging this as part of https://github.com/cloudflare/workers-sdk/milestone/10 and will discuss with the team if this is something we can take on as part of that body of work

@CarmenPopoviciu CarmenPopoviciu added pages Relating to Pages pages-dev Relating to `pages dev` command labels Apr 24, 2024
@treeder
Copy link

treeder commented Apr 24, 2024

I'm with @newsve , can we silence the request log messages? I only want to see what I'm logging. Or perhaps a --verbose option to see every single request. This is what happens now, hundreds of request logs making it hard to find the important stuff:

image

@CarmenPopoviciu CarmenPopoviciu moved this from Backlog to Untriaged in workers-sdk May 8, 2024
@CarmenPopoviciu CarmenPopoviciu moved this from Untriaged to Backlog in workers-sdk May 8, 2024
@CarmenPopoviciu CarmenPopoviciu moved this from Backlog to In Progress in workers-sdk May 14, 2024
@CarmenPopoviciu CarmenPopoviciu self-assigned this May 16, 2024
@CarmenPopoviciu
Copy link
Contributor

CarmenPopoviciu commented May 17, 2024

Hi folks,

First of all, thank you for raising this issue, and for providing us will the information you did <3!

As we are picking this up as part of https://github.com/cloudflare/workers-sdk/milestone/10, I just want to confirm the current state of affairs, as codebase has evolved since this issue was first reported.

Running wrangler pages dev [directory] in wrangler version 3.57.0, in a Pages project with:

  • Functions
  • _routes.json
  • _headers
  • _redirects
  • no wrangler.toml file

currently outputs the following (pls correct me in case I missed anything):

Screenshot 2024-05-17 at 12 40 00

In the original report by @Cherry, the suggested actionable items were:

  • Reduce compat date warnings. [Applicable]
  • Remove --local warning - pages dev is ONLY local and I didn't even pass this. [N/A as these warnings were already removed]
  • Remove "warnings" for valid header rules. [N/A as these were converted to logs instead of warnings, but please see my followup question below]
  • Remove workerd startup warnings with multiple networks in windows. [TBD? will need to repro, but wondering if folks are still experiencing this?]

Subsequent reports also suggested to

  • Silence the request log messages [TBD as this is not pages specific, but is output by both wrangler dev and wrangler pages dev]

// "wrangler dev" output
Screenshot 2024-05-17 at 12 58 13

In addition to what was already suggested in these discussions, I'm wondering if logs such as:

  • Compiling worker to "/.../pages-functions-with-routes-app/.wrangler/tmp/pages-IIkQRR/functionsWorker-0.6251491221119416.mjs"...
  • Parsed 1 valid redirect rule.
  • Parsed 1 valid header rule.

are helpful or become noise? Do you have any input on that?

@Cherry
Copy link
Contributor Author

Cherry commented May 17, 2024

Personally, I think most of my original issues with the verbosity of this have since been resolved.

The compatibility date warning is a bit noisy when you don't specify one (and should maybe recommend wrangler.toml now instead?), but at least you don't get one now from both pages dev, and miniflare.

And then the "Compiling worker" line is a little verbose and unnecessary, but everything else is useful information now I think.

@CarmenPopoviciu
Copy link
Contributor

CarmenPopoviciu commented May 27, 2024

I abs agree with you @Cherry that compat date and fns compilation output is noisy. I'll add fixes for both, plus some extra things to make the output more readable and more organised and circle back here.

IMHO, our stdout formatting in general could use some more structure and consistency, but not sure if there was ever time to properly address this. I'll see if there's smth we can do abt that as well, but that's for later.

In the meanwhile anyone interested in the changes related to this issue can follow the progress over at #5927

CarmenPopoviciu added a commit that referenced this issue Jun 5, 2024
Currently, the compatibility-date related warning in
`pages dev` is noisy and hard to follow.

This commit cleans that up and gives it a more structured
feel.

Fixes #4265
CarmenPopoviciu added a commit that referenced this issue Jun 5, 2024
When running `wrangler dev` or `wrangler pages dev`, the
wrangler banner is not consistently displayed at the top.
For `wrangler pages dev` specifically, which calls
`unstable_dev` under the hood, and thus deferring the
banner printing to this API, the banner ends up getting
lost inbetween other pages-specific logs/warnings, making
the whole `pages dev` output vibe random at best.

This commit ensures we always display the banner at the
top when in dev mode, by:
- delegating the banner printing to `pages dev` directly
- moving calling `printWranglerBanner()` fn first thing
in both wrangler/pages dev handlers
- providing a mechanism in the `unstable_dev` API that
makes the banner printing at that level optional

Fixes #4265
CarmenPopoviciu added a commit that referenced this issue Jun 6, 2024
When running `pages dev` in a project with `_headers` and
`_redirects` files, we currently display a series of
warnings if any invalid headers/redirects rules are found.
These warnings are quite noisy, and not cleanly organised,
thus making the whole `pages dev` output noisy.

This commit cleans up the aforementioned warnings, re-groups
and re-organisez them into more readable/easy to make
sense of output.

Fixes #4265
CarmenPopoviciu added a commit that referenced this issue Jun 6, 2024
This commit changes the verbiage in a `_routes.json`
related warning, surfaced in `pages dev` output, to
something more meaningful and helpful.

Fixes #4265
CarmenPopoviciu added a commit that referenced this issue Jun 6, 2024
When running `pages dev` in a Pages Functions project,
we output the compiled worker output path to stdout.
This path tends to be rather noisy in the grand scheme
of `pages dev` stdout things, and not much helpful.

This commit moves this log to the `debug` output.

Fixes #4265
CarmenPopoviciu added a commit that referenced this issue Jun 6, 2024
When running `wrangler dev` or `wrangler pages dev`, the
wrangler banner is not consistently displayed at the top.
For `wrangler pages dev` specifically, which calls
`unstable_dev` under the hood, and thus deferring the
banner printing to this API, the banner ends up getting
lost inbetween other pages-specific logs/warnings, making
the whole `pages dev` output vibe random at best.

This commit ensures we always display the banner at the
top when in dev mode, by:
- delegating the banner printing to `pages dev` directly
- moving calling `printWranglerBanner()` fn first thing
in both wrangler/pages dev handlers
- providing a mechanism in the `unstable_dev` API that
makes the banner printing at that level optional

Fixes #4265
CarmenPopoviciu added a commit that referenced this issue Jun 6, 2024
When running `pages dev` in a project with `_headers` and
`_redirects` files, we currently display a series of
warnings if any invalid headers/redirects rules are found.
These warnings are quite noisy, and not cleanly organised,
thus making the whole `pages dev` output noisy.

This commit cleans up the aforementioned warnings, re-groups
and re-organisez them into more readable/easy to make
sense of output.

Fixes #4265
CarmenPopoviciu added a commit that referenced this issue Jun 6, 2024
This commit changes the verbiage in a `_routes.json`
related warning, surfaced in `pages dev` output, to
something more meaningful and helpful.

Fixes #4265
CarmenPopoviciu added a commit that referenced this issue Jun 6, 2024
When running `pages dev` in a Pages Functions project,
we output the compiled worker output path to stdout.
This path tends to be rather noisy in the grand scheme
of `pages dev` stdout things, and not much helpful.

This commit moves this log to the `debug` output.

Fixes #4265
CarmenPopoviciu added a commit that referenced this issue Jun 6, 2024
When running `wrangler dev` or `wrangler pages dev`, the
wrangler banner is not consistently displayed at the top.
For `wrangler pages dev` specifically, which calls
`unstable_dev` under the hood, and thus deferring the
banner printing to this API, the banner ends up getting
lost inbetween other pages-specific logs/warnings, making
the whole `pages dev` output vibe random at best.

This commit ensures we always display the banner at the
top when in dev mode, by:
- delegating the banner printing to `pages dev` directly
- moving calling `printWranglerBanner()` fn first thing
in both wrangler/pages dev handlers
- providing a mechanism in the `unstable_dev` API that
makes the banner printing at that level optional

Fixes #4265
CarmenPopoviciu added a commit that referenced this issue Jun 6, 2024
When running `pages dev` in a project with `_headers` and
`_redirects` files, we currently display a series of
warnings if any invalid headers/redirects rules are found.
These warnings are quite noisy, and not cleanly organised,
thus making the whole `pages dev` output noisy.

This commit cleans up the aforementioned warnings, re-groups
and re-organisez them into more readable/easy to make
sense of output.

Fixes #4265
CarmenPopoviciu added a commit that referenced this issue Jun 6, 2024
This commit changes the verbiage in a `_routes.json`
related warning, surfaced in `pages dev` output, to
something more meaningful and helpful.

Fixes #4265
CarmenPopoviciu added a commit that referenced this issue Jun 6, 2024
When running `pages dev` in a Pages Functions project,
we output the compiled worker output path to stdout.
This path tends to be rather noisy in the grand scheme
of `pages dev` stdout things, and not much helpful.

This commit moves this log to the `debug` output.

Fixes #4265
CarmenPopoviciu added a commit that referenced this issue Jun 6, 2024
Currently, the compatibility-date related warning in
`pages dev` is noisy and hard to follow.

This commit cleans that up and gives it a more structured
feel.

Fixes #4265
CarmenPopoviciu added a commit that referenced this issue Jun 6, 2024
When running `wrangler dev` or `wrangler pages dev`, the
wrangler banner is not consistently displayed at the top.
For `wrangler pages dev` specifically, which calls
`unstable_dev` under the hood, and thus deferring the
banner printing to this API, the banner ends up getting
lost inbetween other pages-specific logs/warnings, making
the whole `pages dev` output vibe random at best.

This commit ensures we always display the banner at the
top when in dev mode, by:
- delegating the banner printing to `pages dev` directly
- moving calling `printWranglerBanner()` fn first thing
in both wrangler/pages dev handlers
- providing a mechanism in the `unstable_dev` API that
makes the banner printing at that level optional

Fixes #4265
CarmenPopoviciu added a commit that referenced this issue Jun 6, 2024
When running `pages dev` in a project with `_headers` and
`_redirects` files, we currently display a series of
warnings if any invalid headers/redirects rules are found.
These warnings are quite noisy, and not cleanly organised,
thus making the whole `pages dev` output noisy.

This commit cleans up the aforementioned warnings, re-groups
and re-organisez them into more readable/easy to make
sense of output.

Fixes #4265
CarmenPopoviciu added a commit that referenced this issue Jun 6, 2024
This commit changes the verbiage in a `_routes.json`
related warning, surfaced in `pages dev` output, to
something more meaningful and helpful.

Fixes #4265
CarmenPopoviciu added a commit that referenced this issue Jun 6, 2024
When running `pages dev` in a Pages Functions project,
we output the compiled worker output path to stdout.
This path tends to be rather noisy in the grand scheme
of `pages dev` stdout things, and not much helpful.

This commit moves this log to the `debug` output.

Fixes #4265
CarmenPopoviciu added a commit that referenced this issue Jun 7, 2024
Currently, the compatibility-date related warning in
`pages dev` is noisy and hard to follow.

This commit cleans that up and gives it a more structured
feel.

Fixes #4265
CarmenPopoviciu added a commit that referenced this issue Jun 7, 2024
When running `wrangler dev` or `wrangler pages dev`, the
wrangler banner is not consistently displayed at the top.
For `wrangler pages dev` specifically, which calls
`unstable_dev` under the hood, and thus deferring the
banner printing to this API, the banner ends up getting
lost inbetween other pages-specific logs/warnings, making
the whole `pages dev` output vibe random at best.

This commit ensures we always display the banner at the
top when in dev mode, by:
- delegating the banner printing to `pages dev` directly
- moving calling `printWranglerBanner()` fn first thing
in both wrangler/pages dev handlers
- providing a mechanism in the `unstable_dev` API that
makes the banner printing at that level optional

Fixes #4265
CarmenPopoviciu added a commit that referenced this issue Jun 7, 2024
When running `pages dev` in a project with `_headers` and
`_redirects` files, we currently display a series of
warnings if any invalid headers/redirects rules are found.
These warnings are quite noisy, and not cleanly organised,
thus making the whole `pages dev` output noisy.

This commit cleans up the aforementioned warnings, re-groups
and re-organisez them into more readable/easy to make
sense of output.

Fixes #4265
CarmenPopoviciu added a commit that referenced this issue Jun 7, 2024
This commit changes the verbiage in a `_routes.json`
related warning, surfaced in `pages dev` output, to
something more meaningful and helpful.

Fixes #4265
CarmenPopoviciu added a commit that referenced this issue Jun 7, 2024
When running `pages dev` in a Pages Functions project,
we output the compiled worker output path to stdout.
This path tends to be rather noisy in the grand scheme
of `pages dev` stdout things, and not much helpful.

This commit moves this log to the `debug` output.

Fixes #4265
CarmenPopoviciu added a commit that referenced this issue Jun 7, 2024
When running `pages dev` in a Pages Functions project,
we output the compiled worker output path to stdout.
This path tends to be rather noisy in the grand scheme
of `pages dev` stdout things, and not much helpful.

This commit moves this log to the `debug` output.

Fixes #4265
@CarmenPopoviciu CarmenPopoviciu moved this from In Review to Approved in workers-sdk Jun 7, 2024
RamIdeas pushed a commit that referenced this issue Jun 7, 2024
Currently, the compatibility-date related warning in
`pages dev` is noisy and hard to follow.

This commit cleans that up and gives it a more structured
feel.

Fixes #4265
RamIdeas pushed a commit that referenced this issue Jun 7, 2024
When running `wrangler dev` or `wrangler pages dev`, the
wrangler banner is not consistently displayed at the top.
For `wrangler pages dev` specifically, which calls
`unstable_dev` under the hood, and thus deferring the
banner printing to this API, the banner ends up getting
lost inbetween other pages-specific logs/warnings, making
the whole `pages dev` output vibe random at best.

This commit ensures we always display the banner at the
top when in dev mode, by:
- delegating the banner printing to `pages dev` directly
- moving calling `printWranglerBanner()` fn first thing
in both wrangler/pages dev handlers
- providing a mechanism in the `unstable_dev` API that
makes the banner printing at that level optional

Fixes #4265
RamIdeas pushed a commit that referenced this issue Jun 7, 2024
When running `pages dev` in a project with `_headers` and
`_redirects` files, we currently display a series of
warnings if any invalid headers/redirects rules are found.
These warnings are quite noisy, and not cleanly organised,
thus making the whole `pages dev` output noisy.

This commit cleans up the aforementioned warnings, re-groups
and re-organisez them into more readable/easy to make
sense of output.

Fixes #4265
RamIdeas pushed a commit that referenced this issue Jun 7, 2024
This commit changes the verbiage in a `_routes.json`
related warning, surfaced in `pages dev` output, to
something more meaningful and helpful.

Fixes #4265
RamIdeas pushed a commit that referenced this issue Jun 7, 2024
When running `pages dev` in a Pages Functions project,
we output the compiled worker output path to stdout.
This path tends to be rather noisy in the grand scheme
of `pages dev` stdout things, and not much helpful.

This commit moves this log to the `debug` output.

Fixes #4265
@github-project-automation github-project-automation bot moved this from Approved to Done in workers-sdk Jun 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something that isn't working pages Relating to Pages pages-dev Relating to `pages dev` command
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

7 participants