nestjs / nest

A progressive Node.js framework for building efficient, scalable, and enterprise-grade server-side applications with TypeScript/JavaScript 🚀
https://nestjs.com
MIT License
68.14k stars 7.66k forks source link

Express Adapter Error #11544

Closed PatrykKuniczak closed 1 year ago

PatrykKuniczak commented 1 year ago

Is there an existing issue for this?

Current behavior

I have that error in console, but i don't know the reason why occure, I have it second time, that's not occure everytime and don't break my app.

[Nest] 3384  - 21.04.2023, 21:40:04   ERROR [ExpressAdapter] Premature close
Error: Premature close
    at new NodeError (node:internal/errors:399:5)
    at onclose (node:internal/streams/end-of-stream:154:30)
    at processTicksAndRejections (node:internal/process/task_queues:77:11)

image

If i recognise why it's occure i will give you feedback, but u have a hint to test it, right now.

Minimum reproduction code

https://github.com/PatrykKuniczak/memesChat/tree/dev

Steps to reproduce

I send link for my repo, you can run it, following CONTRIBUTION.md but it's a little complicated project, i send it cause u can see only my nest app config.

That's occure on API app

In the future i can create minimal reproduction, but now i really don't have time.

Expected behavior

Error don't occure

Package

Other package

No response

NestJS version

9.3.7

Packages versions

{
  "name": "api",
  "version": "0.0.1",
  "private": true,
  "license": "UNLICENSED",
  "scripts": {
    "start": "nest start",
    "start:dev": "cross-env NODE_ENV=dev nest start --watch",
    "start:debug": "nest start --debug --watch",
    "build": "cross-env NODE_ENV=prod nest build",
    "documentation:serve": "npx @compodoc/compodoc -p tsconfig.json --serve --port 5010"
  },
  "dependencies": {
    "@compodoc/compodoc": "1.1.19",
    "@nestjs/cli": "9.2.0",
    "@nestjs/common": "9.3.7",
    "@nestjs/config": "2.3.1",
    "@nestjs/core": "9.3.7",
    "@nestjs/jwt": "10.0.2",
    "@nestjs/mapped-types": "1.2.2",
    "@nestjs/passport": "9.0.3",
    "@nestjs/platform-express": "9.3.7",
    "@nestjs/swagger": "6.2.1",
    "@nestjs/typeorm": "9.0.1",
    "bcrypt": "5.1.0",
    "class-transformer": "0.5.1",
    "class-validator": "0.14",
    "multer": "1.4.5-lts.1",
    "passport": "0.6.0",
    "passport-jwt": "4.0.1",
    "passport-local": "1.0.0",
    "pg": "8.9.0",
    "reflect-metadata": "0.1.13",
    "typeorm": "0.3.12"
  },
  "devDependencies": {
    "@nestjs/schematics": "9.0.4",
    "@types/bcrypt": "5.0.0",
    "@types/express": "4.17.17",
    "@types/node": "18.13.0",
    "@types/passport-jwt": "3.0.8",
    "@types/passport-local": "1.0.35",
    "@types/multer": "1.4.7",
    "cross-env": "7.0.3",
    "source-map-support": "0.5.21",
    "ts-loader": "9.4.2",
    "ts-node": "10.9.1",
    "tsconfig-paths": "4.1.2",
    "typescript": "4.9.5"
  },
  "jest": {
    "moduleFileExtensions": [
      "js",
      "json",
      "ts"
    ],
    "rootDir": "src",
    "testRegex": ".*\\.spec\\.ts$",
    "transform": {
      "^.+\\.(t|j)s$": "ts-jest"
    },
    "collectCoverageFrom": [
      "**/*.(t|j)s"
    ],
    "coverageDirectory": "../coverage",
    "testEnvironment": "node"
  }
}

Node.js version

19.6.0

In which operating systems have you tested?

Other

I using npm on Windows 11 and run it on bash console inside WebStorm.

kamilmysliwiec commented 1 year ago

Please, use our Discord channel (support) for such questions. We are using GitHub to track bugs, feature requests, and potential improvements.