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.

Hint that using `data` is wrong

See original GitHub issue

From time to time i see ppl using data instead of body which is wrong. happened just recently in https://github.com/node-fetch/node-fetch/issues/481#issuecomment-717864624

how do you feel about adding a little warning message that can only appear once. (kinda like node reports that you are using experimental apis)

if ('data' in bodyInit && notWarned) {
  console.warn('use body instead')
}
class Response {
  get data () {
    notWarned && console.warn('you want to use .json(), .text(), .arrayBuffer() or just .body')
  }
}

I don’t think it is uncommon to see those mistake happening when switching from different request libraries axios use data instead of body for example. I can admit that i have used data as well and wasted minutes trying to figure out what’s wrong

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:3
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

13reactions
jimmywartingcommented, Dec 25, 2020

Yay, i claimed issue 1000 🎉

0reactions
jimmywartingcommented, Dec 27, 2020

It’s a good idea, but I’m not sure how far we should deviate from the original fetch spec.

it’s not like we are adding any new feature/method into fetch, it’s just a way of helping/notifying that what you might be doing is wrong. such notification could easily be removed if we ever decide to ditch it again

Read more comments on GitHub >

github_iconTop Results From Across the Web

Excel Tips: A Trick for Finding Inconsistent Data - GCF Global
Finding inconsistent data in a large spreadsheet can be time consuming. This Excel trick can make it much easier.
Read more >
The Problem With Data Is Too Much Of The Wrong Stuff.
Siloed business systems and incompatible data are the major culprits. That leaves companies faced with more than just lost productivity, ...
Read more >
Formatting problems – Data Organization in Spreadsheets for ...
What are some common challenges with formatting data in spreadsheets and how can we avoid them? Objectives. Recognize and resolve common spreadsheet ...
Read more >
How to know the hint/ solution in exercise sheet - Kaggle
it wont work for me when i uncomment it and it says q1.hint() i click run and it comes back with an error...
Read more >
How to Make Custom Excel Data Validation Message Help ...
The default error alert settings block people from entering invalid data in the data validation cell. With those default settings, if you try...
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