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.

body-parser throws errors with ES6 / Babel 7 setup

See original GitHub issue

depd throws an error with Babel 7 setup

index.js:252
  var file = callSite.getFileName() || '<anonymous>'
                      ^

TypeError: callSite.getFileName is not a function

The bug was fixed in version 2.0.0 depd, and compiling with Babel 7 exposes the error

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:13 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
dougwilsoncommented, Mar 14, 2022

FYI the master branch now has depd 2.0.0, if you wanted to test it prior to release. Otherwise the release should come out as a minor sometime this week.

1reaction
dougwilsoncommented, Feb 23, 2022

Ok, I modified index.js to include console.log("OK") and the output prints OK, so I guess then it is working fine. I tried on two different machines. I’m not sure how else to help, as without being able to reproduce the issue, I cannot help determine the cause. I would perhaps encourage one of the following courses of actions:

  1. Try on a different machine, from your ZIP; see if it reproduces or not (I tried on Windows and Mac OS X). It may be something wrong with the environment on your one machine if you’ve only tried it on one place.
  2. Open a PR that adds a test case to the module that demonstrates it failing in the CI. This gives a common ground place to see the failure and begin to debug that we both have access to.
  3. Open a PR with a fix for the issue after you have debugged it and determined the case.

I’m sorry I don’t have anything better than the above, but without being able to reproduce the issue, I am unable to help determine a fix 😦

Read more comments on GitHub >

github_iconTop Results From Across the Web

Babel transpiled ES6 code (node.js) successfully, but when do ...
Dear all the issue is resolved now, the error is in the path defined at server.js at the below line: -import account from...
Read more >
babel/parser
errorRecovery: By default, Babel always throws an error when it finds some invalid code. When this option is set to true , it...
Read more >
Node.js Notes for Professionals
Section 35.1: Node ES6 Support and creating a project with Babel ... Section A.7: Install Node.js from source on Centos, RHEL and Fedora....
Read more >
Babel issue running npm run dev after upgrade to Mix
I have an old Laravel App which I updated to Laravel 5.8. I removed all old resources files, package-lock.json, yarn.lock and gulp files....
Read more >
Building a RESTful API with Express, PostgreSQL, and Node ...
With babel setup, we can now create our RESTful API using ES6. ... if (value.length < 8) { throw new Error('Password should be...
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