Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FastifyAdapter type error #10596

Closed
3 of 15 tasks
igor17400 opened this issue Nov 24, 2022 · 4 comments
Closed
3 of 15 tasks

FastifyAdapter type error #10596

igor17400 opened this issue Nov 24, 2022 · 4 comments
Labels
needs triage This issue has not been looked into

Comments

@igor17400
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Current behavior

Following this tutorial to implement nestJS + fastify as lambda function is not working due to FastifyAdapter type error.

It seems that this bug has already been reported in #3671 and in #3655, however, no solution has been provided.

Minimum reproduction code

https://gist.github.com/igor17400/c070c7808f4a61911c08dc2d77f08f4e

Steps to reproduce

No response

Expected behavior

No error when declaring an instance on FastifyAdapter() constructor.

Package

  • I don't know. Or some 3rd-party package
  • @nestjs/common
  • @nestjs/core
  • @nestjs/microservices
  • @nestjs/platform-express
  • @nestjs/platform-fastify
  • @nestjs/platform-socket.io
  • @nestjs/platform-ws
  • @nestjs/testing
  • @nestjs/websockets
  • Other (see below)

Other package

No response

NestJS version

No response

Packages versions


{
  "name": "forest",
  "version": "0.0.0",
  "license": "MIT",
  "scripts": {},
  "private": true,
  "devDependencies": {
    "@nestjs/schematics": "^9.0.0",
    "@nestjs/testing": "^9.0.0",
    "@nrwl/cli": "15.2.1",
    "@nrwl/cypress": "15.2.1",
    "@nrwl/eslint-plugin-nx": "15.2.1",
    "@nrwl/jest": "15.2.1",
    "@nrwl/js": "15.2.1",
    "@nrwl/linter": "15.2.1",
    "@nrwl/nest": "15.2.1",
    "@nrwl/next": "^15.2.1",
    "@nrwl/node": "15.2.1",
    "@nrwl/react": "15.2.1",
    "@nrwl/web": "15.2.1",
    "@nrwl/workspace": "15.2.1",
    "@testing-library/react": "13.4.0",
    "@types/jest": "28.1.1",
    "@types/node": "18.7.1",
    "@types/react": "18.0.20",
    "@types/react-dom": "18.0.6",
    "@typescript-eslint/eslint-plugin": "^5.36.1",
    "@typescript-eslint/parser": "^5.36.1",
    "aws-lambda": "^1.0.7",
    "babel-jest": "28.1.1",
    "cypress": "^11.0.0",
    "eslint": "~8.15.0",
    "eslint-config-next": "13.0.0",
    "eslint-config-prettier": "8.1.0",
    "eslint-plugin-cypress": "^2.10.3",
    "eslint-plugin-import": "2.26.0",
    "eslint-plugin-jsx-a11y": "6.6.1",
    "eslint-plugin-react": "7.31.8",
    "eslint-plugin-react-hooks": "4.6.0",
    "jest": "28.1.1",
    "jest-environment-jsdom": "28.1.1",
    "nx": "15.2.1",
    "prettier": "^2.6.2",
    "react-test-renderer": "18.2.0",
    "ts-jest": "28.0.5",
    "ts-node": "10.9.1",
    "typescript": "~4.8.2"
  },
  "dependencies": {
    "@nestjs/common": "^9.0.0",
    "@nestjs/core": "^9.0.0",
    "@nestjs/platform-express": "^9.0.0",
    "@nestjs/platform-fastify": "^9.2.0",
    "@tailwindcss/typography": "^0.5.8",
    "autoprefixer": "^10.4.13",
    "aws-lambda-fastify": "^2.2.0",
    "aws-serverless-fastify": "^3.0.0",
    "core-js": "^3.6.5",
    "fastify": "^4.10.2",
    "next": "13.0.0",
    "postcss": "^8.4.19",
    "react": "18.2.0",
    "react-dom": "18.2.0",
    "reflect-metadata": "^0.1.13",
    "regenerator-runtime": "0.13.7",
    "rxjs": "^7.0.0",
    "tailwindcss": "^3.2.4",
    "tslib": "^2.3.0"
  }
}


Node.js version

v18.11.0

In which operating systems have you tested?

  • macOS
  • Windows
  • Linux

Other

No response

@igor17400 igor17400 added the needs triage This issue has not been looked into label Nov 24, 2022
@micalevisk
Copy link
Member

micalevisk commented Nov 24, 2022

show us the error message, please.

@micalevisk
Copy link
Member

micalevisk commented Nov 24, 2022

looks like this is a dependency version mismatch. See
npm view @nestjs/platform-fastify dependencies

If you install fastify@4.9 instead of the latest (4.10), it should work

@micalevisk
Copy link
Member

this issue will be fixed after #10583 I just tested it.

@kamilmysliwiec
Copy link
Member

#10583

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs triage This issue has not been looked into
Projects
None yet
Development

No branches or pull requests

3 participants