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

Fix bug activator function object missing properties (fs.realpath.native is undefined) #144

Conversation

geralfonso
Copy link

Hey,
This pr is aiming to solve this issue: #143
This sandbox replicate the issue: sandbox

Initially I was getting fs.realpath.native as undefined when using continuation-local-storage which is using async-listener as dependency. And continuation-local-storage in conjunction with fs-extra v10 are throwing this error.
So in this particular case, I traced the issue to here. What's happening is that we are returning the wrapper without the original function object properties.

This shallow copy should be solve the problem by attaching the original function object properties to the wrapper function.

@Qard
Copy link
Collaborator

Qard commented Jan 14, 2022

Why are you still using this? Node.js core has had AsyncLocalStorage for awhile now. If that's not an option, you could at least use cls-hooked which is at least a whole lot more up-to-date than this module which hasn't been maintained for years. 😅

@geralfonso
Copy link
Author

geralfonso commented Jan 14, 2022

Why are you still using this? Node.js core has had AsyncLocalStorage for awhile now. If that's not an option, you could at least use cls-hooked which is at least a whole lot more up-to-date than this module which hasn't been maintained for years. 😅

Oh Yeah, thanks the for the suggestion. You're right!

@geralfonso geralfonso closed this Jan 14, 2022
@geralfonso geralfonso deleted the fix_activator_function_object_missing_properties branch January 14, 2022 12:49
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

Successfully merging this pull request may close these issues.

2 participants