FastifyError: Unsupported Media Type: application/x-www-form-urlencoded
See original GitHub issueBug Report
Current behavior
After upgrading the fastify adapter to the latest version (7.4.2) it stopped working with POST requests, it simply throws the following error: “Unsupported Media Type: application/x-www-form-urlencoded +54073ms | FastifyError: Unsupported Media Type: application/x-www-form-urlencoded” I’m also using the following plugins:
"fastify-compress": "^3.3.0",
"fastify-cookie": "^4.0.2",
"fastify-multipart": "^2.0.3",
"fastify-rate-limit": "^4.0.2",
"fastify-swagger": "^3.3.0",
Input Code
Simply create a new project, use the latest adapter, create a post handler and the error surges
Expected behavior
It should parse as previously, right now if complaints about formbody plugin but if i add the plugin it also throws error saying its already registered. Now the error is internal and out of control in my side
Possible Solution
Environment
Nest version: 7.4.2 (latest)
For Tooling issues:
- Node version: 12.16.1
- Platform: Linux
Others:
Issue Analytics
- State:
- Created 3 years ago
- Comments:14 (6 by maintainers)
Top Results From Across the Web
Giving error with node/fastify Unsupported Media Type
Why is my Ajax request sending "Content-Type: application/x-www-form-urlencoded" when I have dataType: "JSON"? 1 · request.post continues to ...
Read more >Unsupported media type \"application/x-www-form-urlencoded
Giving error with node/fastify Unsupported Media Type: application/x-www-form-urlencoded. Asked Nov 13, 2020 • 3 votes 2 answers. QUESTION ANSWERS.
Read more >Solved: application/x-www-form-urlencoded content type err...
I'm using a webhook created by Unbounce forms. The problem with the webhook is that it sends the payload with a content type...
Read more >ContentTypeParser - Fastify
Content-Type Parser. Natively, Fastify only supports 'application/json' and 'text/plain' content types. If the content type is not one of these, ...
Read more >fastify-formbody - npm
fastify-formbody@5.3.0` has been deprecated. Please use `@fastify/formbody@6.0.0` instead.. Latest version: 5.3.0, last published: 8 months ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@jmcdo29 Manage to find the issue, the issue with related with nest swagger module for fastify
Lets track this here https://github.com/nestjs/swagger/issues/891