nestjs-mailer-react-adapter icon indicating copy to clipboard operation
nestjs-mailer-react-adapter copied to clipboard

0.2.1 version error

Open fcpauldiaz opened this issue 1 year ago • 2 comments
trafficstars

After upgrading to 0.2.1 I get this error

 ERROR [EmailService] TypeError [ERR_INVALID_ARG_TYPE]: The "chunk" argument must be of type string or an instance of Buffer or Uint8Array. Received an instance of Promise

Downgrading fixes the error

fcpauldiaz avatar Sep 26 '24 21:09 fcpauldiaz

Thanks for reporting this, @fcpauldiaz. Could you share more details about the platform you’re running on and the versions of Node and NestJS you’re using? I’m also working with this library and haven’t encountered the issue so far.

kodjunkie avatar Oct 01 '24 10:10 kodjunkie

@kodjunkie thanks for the follow up, I had the same issue on MacOs and Amazon Linux. My local environment uses node 20.12 and the Amazon one uses node 20.17, both use same Nest versions.

"@nestjs-modules/mailer": "^2.0.2",
 "@nestjs/common": "^10.4.3",
  "@nestjs/config": "^3.2.3",
  "@nestjs/core": "^10.4.3",
  "@nestjs/mapped-types": "^2.0.5",
  "@nestjs/platform-express": "^10.4.3",
  "@nestjs/schedule": "^4.1.1",

and here is the full package.json

{
  "name": "elyphant-bk",
  "version": "1.1.0",
  "description": "",
  "author": "",
  "private": true,
  "license": "UNLICENSED",
  "scripts": {
    "build": "nest build",
    "format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
    "dev": "nest start --watch",
    "start": "nest start",
    "start:debug": "nest start --debug --watch",
    "start:prod": "npx prisma migrate deploy && node dist/src/main",
    "lint": "eslint \"{src,apps,libs,test}/**/*.ts\"",
    "lint:fix": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
    "format:check": "prettier --check .",
    "format:fix": "prettier --write .",
    "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 ./test/jest-e2e.json",
    "test:integration": "jest --config ./test/integration/jest-integration.json --verbose"
  },
  "dependencies": {
    "@golevelup/nestjs-stripe": "^0.8.2",
    "@nestjs-modules/mailer": "^2.0.2",
    "@nestjs/common": "^10.4.3",
    "@nestjs/config": "^3.2.3",
    "@nestjs/core": "^10.4.3",
    "@nestjs/mapped-types": "^2.0.5",
    "@nestjs/platform-express": "^10.4.3",
    "@nestjs/schedule": "^4.1.1",
    "@prisma/client": "^5.19.1",
    "@react-email/components": "^0.0.25",
    "@webtre/nestjs-mailer-react-adapter": "0.2.0",
    "helmet": "^7.1.0",
    "ioredis": "^5.4.1",
    "mathjs": "^13.1.1",
    "nodemailer": "^6.9.15",
    "react": "^18.3.1",
    "reflect-metadata": "^0.2.2",
    "rxjs": "^7.8.1",
    "stripe": "^16.12.0"
  },
  "devDependencies": {
    "@eslint/eslintrc": "^3.1.0",
    "@eslint/js": "^9.10.0",
    "@nestjs/cli": "^10.4.5",
    "@nestjs/schematics": "^10.1.4",
    "@nestjs/testing": "^10.4.3",
    "@types/express": "^4.17.21",
    "@types/jest": "^29.5.13",
    "@types/node": "^22.5.5",
    "@types/nodemailer": "^6.4.16",
    "@types/react": "^18.3.8",
    "@types/supertest": "^6.0.2",
    "@typescript-eslint/eslint-plugin": "^8.6.0",
    "@typescript-eslint/parser": "^8.6.0",
    "eslint": "^9.10.0",
    "eslint-config-prettier": "^9.1.0",
    "eslint-plugin-prettier": "^5.2.1",
    "globals": "^15.9.0",
    "jest": "^29.7.0",
    "prettier": "^3.3.3",
    "prisma": "^5.19.1",
    "prisma-dbml-generator": "^0.12.0",
    "source-map-support": "^0.5.21",
    "supertest": "^7.0.0",
    "ts-jest": "^29.2.5",
    "ts-loader": "^9.5.1",
    "ts-node": "^10.9.2",
    "tsconfig-paths": "^4.2.0",
    "typescript": "^5.6.2"
  },
  "prisma": {
    "seed": "ts-node prisma/seed.ts"
  },
  "jest": {
    "moduleFileExtensions": [
      "js",
      "json",
      "ts"
    ],
    "rootDir": "src",
    "testRegex": ".*\\.spec\\.ts$",
    "transform": {
      "^.+\\.(t|j)s$": "ts-jest"
    },
    "collectCoverageFrom": [
      "**/*.(t|j)s"
    ],
    "coverageDirectory": "../coverage",
    "testEnvironment": "node",
    "preset": "ts-jest",
    "moduleNameMapper": {
      "^@/(.*)$": "<rootDir>/$1"
    }
  },
  "packageManager": "[email protected]"
}

fcpauldiaz avatar Oct 03 '24 22:10 fcpauldiaz

Having the same issue here.

lucswart avatar Oct 11 '24 12:10 lucswart

I just pushed a new version to fix this, thank you for catching the bug.

kodjunkie avatar Oct 12 '24 09:10 kodjunkie