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

Error in depd module node upgradation 8.x.x #3919

Closed
Ashish131989 opened this issue Apr 1, 2019 · 12 comments
Closed

Error in depd module node upgradation 8.x.x #3919

Ashish131989 opened this issue Apr 1, 2019 · 12 comments

Comments

@Ashish131989
Copy link

Ashish131989 commented Apr 1, 2019

Getting TypeError: callSite.getFileName is not a function error after upgrading node version from 6.14.3 to 8.15.1.
same issue is gettting for 10.x.x node version.

I did update the version which were listed as outdated but still facing same issue for some of the dependent module.

Errors:
var file = callSite.getFileName() || ‘’
TypeError: callSite.getFileName is not a function
Dependent Module:
node_modules\body-parser\node_modules\depd\index.js:252:1234:
node_modules\sandboxed-module\lib\sandboxed_module.js:251:19
node_modules\body-parser\index.js:14:32)

how can I get the compitable versions of dependant modules

@dougwilson
Copy link
Contributor

I can take a look. Can you provide complete steps to reproduce the issue? I installed Node.js 8.15.1 and then installed Express.js 4.16.4 and then just ran the Express.js hello world app and no errors and everything is working. We also have Node.js 8 and 10 running on Travis CI without that error.

@Ashish131989
Copy link
Author

Ashish131989 commented Apr 3, 2019

I have node version 6.17.0 installed on my local machine.here are the steps I followed to upgrade node version from 6.17.0 to 8.15.0

  1. Download node 8.15.1
  2. Change the environment variable path to point to node 8.15.1 folder
  3. Restarted the visual studio code editor to apply those changes.
  4. Validate the outdated modules for my app and updated the the same with latest stable versions.
  5. Upgraded the Express version to 4.16.4
  6. Run unit tests(mocha and chai)
  7. Got above mentioned error TypeError: callSite.getFileName

Note :
1.Tried the same steps with different application but result was same.
2.Upgraded node to 10.x.x but got same issue.
3.I have tried above steps using different Express 4.x.x versions but no luck.

@dougwilson
Copy link
Contributor

Hi @Ashish131989 thank you so much for the steps you provided! I realized that I left out that the intention is so that I could perform the same steps on my machine so I can reproduce and thus be able to debug the error. The steps above seem to be using some code I don't have access to, so I'm not able to follow them. Would you be able to provide steps using something like the express generator as the starting point, or share your code with me somehow?

@Ashish131989
Copy link
Author

Ashish131989 commented Apr 25, 2019

Hi @dougwilson Sorry I was out for some reason, I dont have rights to share my code,let me see if I can write sample app, The application is running fine it's all about unit mocha tests which are failing.
For all unit tests we are using fakes for logging into our application , for that we are consuming sandbox module . Below is the error I'm getting after running unit tests.

Also if you can see here the issue was reported eariler for express module and it was resolved in next version.

#2262

var file = callSite.getFileName() || '<anonymous>'
                      ^

TypeError: callSite.getFileName is not a function
    at callSiteLocation (C:\MMS_Github\MMS Upgrade 10\ManageMyStaff\node_modules\body-parser\node_modules\depd\index.js:252:23)
    at depd (C:\MMS_Github\MMS Upgrade 10\ManageMyStaff\node_modules\body-parser\node_modules\depd\index.js:111:14)
    at Object.<anonymous> (C:\MMS_Github\MMS Upgrade 10\ManageMyStaff\node_modules\body-parser\index.js:14:32)
    at SandboxedModule._compile (C:\MMS_Github\MMS Upgrade 10\ManageMyStaff\node_modules\sandboxed-module\lib\sandboxed_module.js:251:19)
    at createInnerSandboxedModule (C:\MMS_Github\MMS Upgrade 10\ManageMyStaff\node_modules\sandboxed-module\lib\sandboxed_module.js:183:23)
    at SandboxedModule.RecursiveRequireProxy (C:\MMS_Github\MMS Upgrade 10\ManageMyStaff\node_modules\sandboxed-module\lib\sandboxed_module.js:214:27)
    at Object.<anonymous> (C:\MMS_Github\MMS Upgrade 10\ManageMyStaff\node_modules\express\lib\express.js:15:18)
    at SandboxedModule._compile (C:\MMS_Github\MMS Upgrade 10\ManageMyStaff\node_modules\sandboxed-module\lib\sandboxed_module.js:251:19)
    at createInnerSandboxedModule (C:\MMS_Github\MMS Upgrade 10\ManageMyStaff\node_modules\sandboxed-module\lib\sandboxed_module.js:183:23)
    at SandboxedModule.RecursiveRequireProxy (C:\MMS_Github\MMS Upgrade 10\ManageMyStaff\node_modules\sandboxed-module\lib\sandboxed_module.js:214:27)
npm ERR! Test failed.  See above for more details.

@dougwilson
Copy link
Contributor

Thanks @Ashish131989 . I'm not saying it isn't fixable, but in order for me to be able to work on a fix, I have to be able to reproduce it somehow. There is nothing I can do to help unless you can provide reproducing steps.

@Ashish131989
Copy link
Author

@dougwilson I'm writing sample app to reproduce this issue I will keep you posted soon

@dougwilson
Copy link
Contributor

Thank you

@Ashish131989
Copy link
Author

@dougwilson can you share your email ID, I'm facing issues with my git account.
I will share sample code with you.

@Ashish131989
Copy link
Author

@dougwilson - Sharing the sample application with you on below path.
https://github.com/Ashish131989/depd-module-Issues

Steps to reproduce.
Run the only unit tests - npm t for above sample student forum application.

Let me know for more details

@dougwilson
Copy link
Contributor

Thanks for that. It is a bug in the https://www.npmjs.com/package/sandboxed-module causing your issue. It breaks Node.js APIs like https://nodejs.org/dist/latest-v12.x/docs/api/errors.html#errors_error_capturestacktrace_targetobject_constructoropt and https://nodejs.org/dist/latest-v12.x/docs/api/errors.html#errors_error_stacktracelimit because the globals inside the sandbox do not belong to the sandbox.

The bug here is the same issue that is causing your error: felixge/node-sandboxed-module#44

@Ashish131989
Copy link
Author

@dougwilson thanks for the reference, It seems to be different issues with sandboxed- module for the thread which you shared. I have raised my concern to sandboxed-module team but didn't get any reply back. Do you have any thought how can I proceed now?

@HeyParkerJ

This comment has been minimized.

@expressjs expressjs deleted a comment from snehahaldankar Feb 9, 2022
@expressjs expressjs locked as resolved and limited conversation to collaborators Feb 9, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants