Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[node-compat] Lack of AsyncLocalStorage.disable() implementation #22886

Closed
yasaichi opened this issue Mar 13, 2024 · 2 comments · Fixed by #24402
Closed

[node-compat] Lack of AsyncLocalStorage.disable() implementation #22886

yasaichi opened this issue Mar 13, 2024 · 2 comments · Fixed by #24402
Labels
bug Something isn't working correctly node API Related to various "node:*" modules APIs node compat

Comments

@yasaichi
Copy link

yasaichi commented Mar 13, 2024

Version: Deno 1.41.1

When I was using MSW, one of the most popular HTTP mocking libraries, I faced an error caused by a lack of AsyncLocalStorage.disable() of node:async_hooks module. Here is the minimum code to reproduce the issue:

$ node
Welcome to Node.js v20.5.0.
Type ".help" for more information.
> new (await import('node:async_hooks')).AsyncLocalStorage().disable()
undefined
$ deno
Deno 1.41.1
exit using ctrl+d, ctrl+c, or close()
REPL is running with all permissions allowed.
To specify permissions, run `deno repl` with allow flags.
> new (await import('node:async_hooks')).AsyncLocalStorage().disable()
Uncaught TypeError: (intermediate value).disable is not a function
    at <anonymous>:1:81

This would help MSW work in Deno and more people adopt this great runtime. Thanks!

@yasaichi yasaichi changed the title [node-compat] [node-compat] Lack of AsyncLocalStorage.disable() implementation Mar 13, 2024
@bartlomieju bartlomieju added bug Something isn't working correctly node compat node API Related to various "node:*" modules APIs labels Mar 13, 2024
@devsnek devsnek closed this as completed in 3a1a1cc Aug 2, 2024
@yasaichi
Copy link
Author

yasaichi commented Aug 21, 2024

@bartlomieju
Could you reopen the issue? Because #24402 was reverted but has not been re-merged yet.

@devsnek
Copy link
Member

devsnek commented Aug 21, 2024

Thanks for reminding me... #25140

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working correctly node API Related to various "node:*" modules APIs node compat
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants