chunyenHuang / hummusRecipe

A powerful PDF tool for NodeJS based on HummusJS.
https://hummus-recipe.s3.amazonaws.com/docs/Recipe.html
MIT License
340 stars 91 forks source link

App crashes when trying to create or edit PDF #198

Closed Suroor-Ahmmad closed 4 years ago

Suroor-Ahmmad commented 4 years ago

I'm facing a weird issue in my app running inside docker container, app crashes without any error message, I even tried to catch the exception but still no success. Works very much fine in my local, with same version of hummus and hummus-recipe. Any help on this will be appreciated.

Update: Tried running the app outside docker and it works perfectly. I'm running npm install and npm run build outside the docker and tried by building hummus from source npm rebuild hummus --build-from-source

package.json

{
    ...
    "dependencies": {
    "@airbrake/node": "^1.4.1",
    "@nestjs/common": "^6.0.0",
    "@nestjs/core": "^6.0.0",
    "@nestjs/mongoose": "^6.1.2",
    "@nestjs/passport": "^6.1.0",
    "@nestjs/platform-express": "^6.0.0",
    "@nestjs/swagger": "^3.1.0",
    "@typegoose/typegoose": "^6.0.3",
    "@types/bcryptjs": "^2.4.2",
    "aws-sdk": "^2.639.0",
    "bcryptjs": "^2.4.3",
    "class-transformer": "^0.2.3",
    "class-validator": "^0.10.1",
    "decompress-response": "^4.2.1",
    "dotenv": "^8.1.0",
    "exceljs": "^4.1.1",
    "hummus": "^1.0.108",
    "hummus-recipe": "^1.9.9",
    "image-downloader": "^3.5.0",
    "moment": "^2.24.0",
    "mongoose": "^5.7.4",
    "multer": "^1.4.2",
    "multer-s3": "^2.9.0",
    "nestjs-typegoose": "^7.0.0",
    "node-gzip": "^1.1.2",
    "nodemailer": "^6.4.2",
    "number-to-words": "^1.2.4",
    "passport": "^0.4.0",
    "passport-jwt": "^4.0.0",
    "passport-local": "^1.0.0",
    "reflect-metadata": "^0.1.12",
    "rimraf": "^2.6.2",
    "rxjs": "^6.3.3",
    "saslprep": "^1.0.3",
    "soap": "^0.29.0",
    "swagger-ui-express": "^4.1.2",
    "typegoose": "^5.9.1"
},
"devDependencies": {
    "@nestjs/testing": "^6.0.0",
    "@types/dotenv": "^6.1.1",
    "@types/express": "^4.16.0",
    "@types/jest": "^23.3.13",
    "@types/mongoose": "^5.5.20",
    "@types/node": "^10.12.18",
    "@types/node-gzip": "^1.1.0",
    "@types/passport": "^1.0.1",
    "@types/passport-local": "^1.0.33",
    "@types/supertest": "^2.0.7",
    "@types/bcrypt": "^3.0.0",
    "@types/jsonwebtoken": "^8.3.4",
    "@types/nodemailer": "^6.4.0",
    "@types/number-to-words": "^1.2.0",
    "@types/soap": "^0.21.0",
    "concurrently": "^4.1.0",
    "jest": "^23.6.0",
    "nodemon": "^1.18.9",
    "prettier": "^1.15.3",
    "supertest": "^3.4.1",
    "ts-jest": "24.0.2",
    "ts-loader": "^6.2.0",
    "ts-node": "8.1.0",
    "tsconfig-paths": "3.8.0",
    "tslint": "5.16.0",
    "typescript": "3.4.3",
    "wait-on": "^3.2.0",
    "webpack": "^4.41.0",
    "webpack-cli": "^3.3.9",
    "webpack-node-externals": "^1.7.2"
},
}
Suroor-Ahmmad commented 4 years ago

Tried solutions #170

Suroor-Ahmmad commented 4 years ago

Adding below commands to dockerfile resolved the issue

RUN apk add  g++ gcc libgcc libstdc++ linux-headers make python
RUN npm install -g node-gyp 
RUN npm install
RUN npm rebuild hummus --build-from-source