question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to make "quiet" `fetch` request?

See original GitHub issue

Expected Behavior

When I wrap a fetch request in a quiet, I expect it not to log anything to the console. Eg:

const response = await quiet(fetch(url));

Actual Behavior

The script logs the following to the console:

$ fetch {url}

Is this behaviour deliberate, or is it a bug? Is there any way to make a “quiet” fetch request otherwise?

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
antonmedvcommented, May 31, 2022

You can disable it with:

$.verbose = false

Or import from node-fetch.

import fetch from 'node-fetch'

await fetch(url)
1reaction
antongolubcommented, Aug 3, 2022
fetch.quiet = (...args) => within(() => {
  $.log = () => {}
  return fetch(...args)
})
Read more comments on GitHub >

github_iconTop Results From Across the Web

Run git fetch with `--quiet` by default · Issue #489 - GitHub
Currently this prints one line per 1 or 2 % progress, for each of remote: Counting objects , remote: Compressing objects , Receiving...
Read more >
git-fetch Documentation - Git
Pass --quiet to git-fetch-pack and silence any other internally used git commands. Progress is not reported to the standard error stream. Be verbose....
Read more >
Using the Fetch API - MDN Web Docs
The Fetch API provides a JavaScript interface for accessing and manipulating parts of the protocol, such as requests and responses.
Read more >
Illegally mutated the NSFetchedResultsController's fetch request ...
Try disabling caching. When you create the NSFetchedResultsController , pass nil as the cache name.
Read more >
Fetch API and FormData in HTML world | by Arun Rajeevan
Fetch API : Provides a JavaScript interface for accessing and manipulating parts of the HTTP pipeline, such as requests and responses.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found