Comments (5)
I've started getting the same error recently
from on-finished.
Thank you both. I test this module in CI on almost every Node.js version without issue. If one of you can either provide a fix or provide instructions for how to replicate, thay would help, otherwise I'm not sure what can be done. The request is even in a try catch block too.
from on-finished.
Thank you both. I test this module in CI on almost every Node.js version without issue. If one of you can either provide a fix or provide instructions for how to replicate, thay would help, otherwise I'm not sure what can be done. The request is even in a try catch block too.
My node version is 16.9.1. I posted the same question on Stackoverflow but didn't receive any responses. The issue is as follows:
warning in ./node_modules/[email protected]@on-finished/index.js
Module not found: Error: Can't resolve 'async_hooks' in 'D:\project\xy2022\node_modules\[email protected]@on-finished'
warning in ./node_modules/[email protected]@raw-body/index.js
Module not found: Error: Can't resolve 'async_hooks' in 'D:\project\xy2022\node_modules\[email protected]@raw-body'
Although it runs normally, it feels awkward. My colleague and I have the same version of Node, but he doesn't get this error on his machine.
Reinstall node, upgrade to the latest version, install async_hooks, and add conditional statements in the two problematic files. There might be some issues with the implementation
function tryRequireAsyncHooks () {
try {
return require('async_hooks')
// return {}
} catch (e) {
return {}
}
}
Both sides of the code have errors in this function. I have a feeling that I haven't used these two plugins in my project. Changing 'return require('async_hooks')' to 'return {}' resolved the error.
from on-finished.
Thank you. Unfortunately that still doesn't explain how to reproduce the error/warning for me to help diagnose. And of course your provided fiz is not possible to accept, as you just... removed the require by commenting it out, meaning it break environments with async_hooks
...
from on-finished.
I'm going to close this for now until someone can provide reproduction steps and we can reproduce the issue, particularly as no environment in CI has that error/warning at all, so maybe there is something broken with your environment outside of this module and this module is just revealing the broken environment? Thinking because you said your colleague doesn't have the issue (which is the same as me).
from on-finished.
Related Issues (20)
- The current request should be passed to the callback as an argument HOT 15
- Support Upgrade requests HOT 24
- client-side timeout can not be detected. HOT 6
- Return listener-remover instead of response. HOT 1
- Call in LIFO order instead of FIFO HOT 2
- LIFO instead of FIFO HOT 3
- fires before the end of the response HOT 7
- EventEmitter raises a warning about potential memory leak when using on-finished with HTTP2 connections HOT 5
- write EPIPE HOT 6
- unregister listener HOT 1
- Response Body missing After on-finished called HOT 6
- http2 compat tests HOT 1
- Test failed on node version 10 and 11 HOT 6
- isFinished incorrect? HOT 8
- on-finished vs Node stream.finished() HOT 2
- Callback fires immediatly on sendFile HOT 17
- Pipelining and Socket handlers HOT 4
- Grammatical error in Readme.md file HOT 2
- async hooks compatibility? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from on-finished.