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

fs.realpath.native is broken by wrapping #143

Open
trentm opened this issue Oct 29, 2021 · 1 comment
Open

fs.realpath.native is broken by wrapping #143

trentm opened this issue Oct 29, 2021 · 1 comment

Comments

@trentm
Copy link

trentm commented Oct 29, 2021

Hi. In https://github.com/elastic/apm-agent-nodejs we have a fork of this lib (https://github.com/elastic/apm-agent-nodejs/blob/master/lib/instrumentation/patch-async.js). Recently we did a fix for an issue where the wrapping of fs.realpath accidentally wipes out fs.realpath.native. Our patch for that is this: https://github.com/elastic/apm-agent-nodejs/pull/2403/files#diff-68468fdd0c330b902912d266a6d7520b11b168fd1b1c07acc5d85361237a79d5

If someone using this lib runs into this, then hopefully this helps. If this lib is being maintained, poke me and I can look into making a PR with this patch.

@s100
Copy link

s100 commented Jan 20, 2022

Our workaround for this issue is as follows:

const fs = require('fs')
const fs$realpath$native = fs.realpath.native
require('async-listener')
fs.realpath.native = fs$realpath$native

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants