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

@nestjs/platform-fastify 7.4 is a breaking change #5171

Closed
jaybhub opened this issue Jul 30, 2020 · 14 comments
Closed

@nestjs/platform-fastify 7.4 is a breaking change #5171

jaybhub opened this issue Jul 30, 2020 · 14 comments
Labels
needs triage This issue has not been looked into

Comments

@jaybhub
Copy link

jaybhub commented Jul 30, 2020

Bug Report

Current behavior

7.2.x requires fastify 2.x.
7.4.x requires fastify 3.x.
Using 7.4x is breaking projects with fastify 2.x dependencies

const serverOptions: fastify.ServerOptionsAsHttp = {
    logger: ['log', 'error', 'warn'],
  };

throws error: Namespace '"/node_modules/fastify/fastify"' has no exported member 'ServerOptionsAsHttp'. ts(2694) [90, 32]

const instance: fastify.FastifyInstance = fastify(serverOptions);

throws error: This expression is not callable.
Type 'typeof import("/node_modules/fastify/fastify")' has no call signatures.

Input Code

import { FastifyAdapter, NestFastifyApplication } from '@nestjs/platform-fastify';
import * as fastify from '../node_modules/fastify';

let fastifyServer: fastify.FastifyInstance;

async function bootstrap(): Promise<fastify.FastifyInstance> {
  const serverOptions: fastify.ServerOptionsAsHttp = {
    logger: ['log', 'error', 'warn'],
  };
  const instance: fastify.FastifyInstance = fastify(serverOptions);
  const nestApp = await NestFactory.create<NestFastifyApplication>(
    AppModule,
    new FastifyAdapter(instance),
    {
      logger: ['log', 'error', 'warn'],
    },
  );

Expected behavior

Minor increments are non-breaking

Possible Solution

7.4 should be 8.x

Environment


Nest version: 6.14.1

 
For Tooling issues:
- Node version: 12.13.0
- Platform:  Mac

Others:
Using npm and VSCode
@jaybhub jaybhub added the needs triage This issue has not been looked into label Jul 30, 2020
@cazlu8
Copy link

cazlu8 commented Jul 31, 2020

same here, is breaking the Exception filters.

@jaybhub jaybhub changed the title @nestjs/platform-fastify 7.4 should have been major increment @nestjs/platform-fastify 7.4 is a breaking change Aug 7, 2020
@camo-f
Copy link

camo-f commented Aug 10, 2020

It is also a breaking change for projects using GraphQL with Fastify, as apollo-server-fastify does not support Fastify 3.x for now.

@coderdiaz
Copy link

coderdiaz commented Aug 14, 2020

I have the same problem with GraphQL using Fastify with apollo-server-fastify.

@robinsmedberg
Copy link

I have the same problem with GraphQL using Fastify with apollo-server-fastify

@coderdiaz
Copy link

@robinsmedberg Check it out. I'm waiting too for the update from apollo-server-fastify for upgrade to Fastify v3. This is in alpha now.

#5055 (comment)

@cyb3rs4pi3n
Copy link

works fine in "@nestjs/common": "^7.5.2" , "@nestjs/platform-fastify": "^7.5.2",

@camo-f
Copy link

camo-f commented Nov 25, 2020

Also works fine for GraphQL with the following versions

"@nestjs/common": "^7.5.5",
"@nestjs/core": "^7.5.5",
"@nestjs/graphql": "^7.8.2",
"@nestjs/platform-fastify": "^7.5.5",
"apollo-server-fastify": "^2.19.0"

Though the GraphQL playground is not working with [email protected]. The next alpha release is required ([email protected]), see apollographql/apollo-server#4463

@SalahAdDin
Copy link

any solution here?

@MeStrak
Copy link

MeStrak commented Mar 23, 2021

A very recent comment on the v3 roadmap issue in the Apollo Server repo looks like things are progressing, but it also seems lime it won't be a transparent upgrade: apollographql/apollo-server#2360 (comment)

@NickMandylas
Copy link

any solution here?

This version (https://github.com/autotelic/apollo-server-fastify) is maintained/updated & works with Fastify v3.

@SalahAdDin
Copy link

any solution here?

This version (https://github.com/autotelic/apollo-server-fastify) is maintained/updated & works with Fastify v3.

It is not an official one, isn't it?

@NickMandylas
Copy link

any solution here?

This version (https://github.com/autotelic/apollo-server-fastify) is maintained/updated & works with Fastify v3.

It is not an official one, isn't it?

It's not official, but works perfectly fine.

@kuongknight
Copy link

kuongknight commented May 13, 2021

[email protected] didn't work with installSubscriptionHandlers option.
Error: TypeError: this.apolloServer.installSubscriptionHandlers is not a function

@tkow
Copy link

tkow commented Jun 5, 2021

I found sometimes library missed fixed version. If you only install [email protected] and haven't had lock set alpha version, it might break now.
apollographql/apollo-server#5278

@nestjs nestjs locked as off-topic and limited conversation to collaborators Jul 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
needs triage This issue has not been looked into
Projects
None yet
Development

No branches or pull requests