Comments (9)
Hi @tkxkd0159 that is very strange. When morgan tries to write to the stream, it does not wait for the write to complete before continuing, and even then morgan does not write until after the response is completed. I tried with a basic app without issue.
Can you please provide an app that demonstrates the issue and include instructions for how to trigger the condition with the given app? We would be happy to debug the issue. Alternatively you're welcome to make a pull request that fixes the issue.
from morgan.
Thanks for your quick feedback @dougwilson !
My original repository where the problem occurred required several complicated setup processes, so I made a dummy repository that had similar problems (refresh issue). I made a simple example app that separates the backend and the front, and if you press the button called check morgan bug
, the bug is reproduced (Page is refreshed again for current location after receiving a response with fetch). You can also check this with chrome network tab
The address of the source is here. => https://github.com/tkxkd0159/debug-morgan
from morgan.
Hi @tkxkd0159 thanks for that! Are you sure the bug is due to morgan? I ask because in the reproduction code you provided, you have morgan commented out. If you are able to reproduce with that given app, it would seem the issue is unrelated to morgan.
from morgan.
Hi @dougwilson, sorry I forget to uncomment app.use(morgan("common", { stream: accessLogStream }));
so this code works fine (no bug). but when you uncomment morgan part, bus is reproduced.
from morgan.
Thanks. I guess I should clarify that I tried that, and your app acted the same if I had it commented out or not, so I wasn't sure if you were able to reproduce with that app. If that is the case, it seems that for some reason I am unable to reproduce on my system and unfortunately won't be able to help produce a fix without reproducing. You'll need to debug what the cause is and make a pull request with a fix 👍 , as it may be dependent on perhaps something on the system itself.
from morgan.
Thanks @dougwilson. For reference, my environment was Ubuntu 20.04.4 LTS. I'll try to debug this problem.
from morgan.
I tried to check issue this my mac (Monterey 12.4) and WIndows 10 machine. And there was no bug with morgan. Maybe there is something wrong with my linux machine or just compatible issue with Ubuntu focal. I will try to check this.
Thanks
from morgan.
Ah, very interesting. And sorry for not including it, I was using Windows 11.
from morgan.
I tried to test with linux docker container and it works fine. Maybe there is something wrong with my local linux machine. There doesn't seem to be a problem with that package, and it seems to be a problem with my computer. Sorry for raising the wrong issue. I'll close this issue now that the issue has been resolved.
from morgan.
Related Issues (20)
- Error: EBADF: bad file descriptor, write HOT 7
- Is there a way to get the start time instead of the finish time?
- Custom tokens returning function string HOT 1
- Is this compatible with angular 11? HOT 1
- Usage in ES6 promise based import does not work HOT 1
- skip function not working with 'immediate:true' configuration HOT 3
- Colored status token HOT 1
- Dexter Morgan HOT 2
- Use morgan as custom console logger HOT 3
- Adding a token named token causes all subsequent tokens to break. HOT 3
- req.route.path value is undefined HOT 3
- :res[content-length] only shows size less than 1 KB HOT 2
- Support for promise HOT 2
- Getting vulnerable issue [email protected] HOT 1
- Expose `stream.write` as option HOT 2
- webscoket request should be logged HOT 2
- SPDY > Express.JS > Next.JS don't show path details.
- `User: ':remote-user'` does not show logged-in user but `-`
- Issue HOT 1
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 morgan.