After npm audit I've got an error: RangeError: Maximum call stack size exceeded at /node_modules/enhanced-resolve/lib/Resolver.js:433:5

It happened after I run npm audit fix. It works fine localy, but when I try to run it inside docker container (before audit fix it works properly inside docker container as well), I get the error. The last one is:

/node_modules/enhanced-resolve/lib/Resolver.js:433
#9 9.002                                if (err) return callback(err);
#9 9.002                                ^
#9 9.002
#9 9.002 RangeError: Maximum call stack size exceeded
#9 9.002     at /node_modules/enhanced-resolve/lib/Resolver.js:433:5
#9 9.002     at eval (eval at create (/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:27:1)
#9 9.002     at /node_modules/enhanced-resolve/lib/DescriptionFilePlugin.js:88:10
#9 9.002     at /node_modules/enhanced-resolve/lib/Resolver.js:434:24
#9 9.002     at eval (eval at create (/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:27:1)
#9 9.002     at /node_modules/tsconfig-paths-webpack-plugin/lib/plugin.js:103:17
#9 9.002     at /node_modules/enhanced-resolve/lib/Resolver.js:434:24
#9 9.002     at eval (eval at create (/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:12:1)
#9 9.002     at /node_modules/enhanced-resolve/lib/Resolver.js:434:24
#9 9.002     at eval (eval at create (/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:27:1)

I can't write just 'The package-json file seems like so' because from SO point of view I should add some more details, so it looks like:

{
  "name": "monorepo-nestjs",
  "version": "0.0.1",
  "description": "",
  "author": "",
  "private": true,
  "license": "UNLICENSED",
  "scripts": {
    "prebuild": "rimraf dist",
    "build": "nest build",
    "format": "prettier --write \"apps/**/*.ts\" \"libs/**/*.ts\"",
    "start": "nest start",
    "start:dev": "nest start --watch",
    "start:debug": "nest start --debug --watch",
    "start:prod": "node dist/main",
    "lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
    "test": "jest",
    "test:watch": "jest --watch",
    "test:cov": "jest --coverage",
    "test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
    "test:e2e": "jest --config ./apps/monorepo-nestjs/test/jest-e2e.json"
  },
  "dependencies": {
    "@nestjs/axios": "^0.0.5",
    "@nestjs/common": "^8.0.0",
    "@nestjs/config": "^1.1.6",
    "@nestjs/core": "^8.0.0",
    "@nestjs/jwt": "^8.0.0",
    "@nestjs/passport": "^8.1.0",
    "@nestjs/platform-express": "^8.0.0",
    "@nestjs/swagger": "^5.2.0",
    "@nestjs/typeorm": "^8.0.3",
    "class-transformer": "^0.5.1",
    "class-validator": "^0.13.2",
    "crypto-js": "^4.1.1",
    "mssql": "^7.3.0",
    "nest-winston": "^1.6.2",
    "passport": "^0.5.2",
    "passport-http": "^0.3.0",
    "passport-jwt": "^4.0.0",
    "passport-local": "^1.0.0",
    "reflect-metadata": "^0.1.13",
    "rimraf": "^3.0.2",
    "rxjs": "^7.2.0",
    "swagger-ui-express": "^4.3.0",
    "typeorm": "^0.2.41",
    "winston": "^3.5.0"
  },
  "devDependencies": {
    "@nestjs/cli": "^8.0.0",
    "@nestjs/schematics": "^8.0.0",
    "@nestjs/testing": "^8.0.0",
    "@types/express": "^4.17.13",
    "@types/jest": "27.0.2",
    "@types/node": "^16.0.0",
    "@types/passport-http": "^0.3.9",
    "@types/passport-jwt": "^3.0.6",
    "@types/passport-local": "^1.0.34",
    "@types/supertest": "^2.0.11",
    "@typescript-eslint/eslint-plugin": "^5.0.0",
    "@typescript-eslint/parser": "^5.0.0",
    "eslint": "^8.0.1",
    "eslint-config-prettier": "^8.3.0",
    "eslint-plugin-prettier": "^4.0.0",
    "jest": "^27.2.5",
    "prettier": "^2.3.2",
    "source-map-support": "^0.5.20",
    "supertest": "^6.1.3",
    "ts-jest": "^27.0.3",
    "ts-loader": "^9.2.3",
    "ts-node": "^10.0.0",
    "tsconfig-paths": "^3.10.1",
    "typescript": "^4.3.5"
  },
  "jest": {
    "moduleFileExtensions": [
      "js",
      "json",
      "ts"
    ],
    "rootDir": ".",
    "testRegex": ".*\\.spec\\.ts$",
    "transform": {
      "^.+\\.(t|j)s$": "ts-jest"
    },
    "collectCoverageFrom": [
      "**/*.(t|j)s"
    ],
    "coverageDirectory": "./coverage",
    "testEnvironment": "node",
    "roots": [
      "<rootDir>/apps/",
      "<rootDir>/libs/"
    ],
    "moduleNameMapper": {
      "^@app/common-lib(|/.*)$": "<rootDir>/libs/common-lib/src/$1"
    }
  }
}

The Dockerfile of the project seems like below:

FROM node:16.13.1-alpine3.13
ARG APP_TO_BUILD
ENV APP_TO_B=${APP_TO_BUILD}
COPY package*.json ./
RUN npm install
COPY . .
RUN npm run build ${APP_TO_B}
CMD ["sh", "-c", "npm start ${APP_TO_B}"]
How many English words
do you know?
Test your English vocabulary size, and measure
how many words do you know
Online Test
Powered by Examplum