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

Cannot use this plugin on fastify 3.x.x #114

Closed
2 tasks done
bahamut657 opened this issue Jun 3, 2022 · 5 comments · Fixed by #115
Closed
2 tasks done

Cannot use this plugin on fastify 3.x.x #114

bahamut657 opened this issue Jun 3, 2022 · 5 comments · Fixed by #115

Comments

@bahamut657
Copy link

Prerequisites

  • I have written a descriptive issue title
  • I have searched existing issues to ensure the bug has not already been reported

Fastify version

3.29.0

Plugin version

7.0.1 - 7.0.0

Node.js version

16.x

Operating system

Linux

Operating system version (i.e. 20.04, 11.3, 10)

ArchLinux

Description

On task startup I obtain this error:

fastify-plugin: @fastify/formbody - expected '4.x' fastify version, '3.29.0' is installed

I think that this check is wrong (this version must be compatible with Fastify 3.xx)

Steps to Reproduce

const Fastify = require("fastify");
const Formbody = require('@fastify/formbody');
const server = Fastify({
      connectionTimeout: 20 * 1000,
      logger: false
});
server.register(Formbody);
server.listen(3000,"0.0.0.0",(err,address)=>{
    if (err)
        throw err;
   else 
       console.log( "Server is active");
});

Expected Behavior

Plugin works as expected using Fastify v3.xx

@bahamut657 bahamut657 changed the title Cannot use this plugin on fastify v3 Cannot use this plugin on fastify 3.x.x Jun 3, 2022
@Fdawgs
Copy link
Member

Fdawgs commented Jun 3, 2022

Use v6.0.1, v7.x only supports Fastify v4 and above.

@bahamut657
Copy link
Author

Ok It works.
Can u write these notes on module readme please? This information is only on Release Notes
Thank you for the support
Regards

@wlinna
Copy link
Contributor

wlinna commented Jun 3, 2022

I think the issue should remain open until README.md has been fixed. Right now it states the following:

This branch targets Fastify v3. Please refer to this branch and related versions for Fastify ^2.0.0 compatibility.

Nowhere does it tell which version should I use to target Fastify 3.

@RafaelGSS
Copy link
Member

Would you like to send a Pull Request to address this issue?

@wlinna
Copy link
Contributor

wlinna commented Jun 3, 2022

I submitted a PR. I hope I did it correctly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants