res.setHeader is not a function When i add new FastifyAdapter()
See original GitHub issueDescribe the bug
If i put new FastifyAdapter()
like this
const app = await NestFactory.create<NestFastifyApplication>( AppModule, new FastifyAdapter(), )
it will return error when i access localhost:3000
res.setHeader(“Cache-Control”, “no-cache, no-store, max-age=0, must-revalidate”); ^ TypeError: res.setHeader is not a function
Is it can’t support fastify adapter? Because i serve static files from my server use the fastify adapter
Version
- next.js: 13.0.6
- nest: 9.0.0
- nest-next: 10.0.0
Issue Analytics
- State:
- Created 9 months ago
- Reactions:1
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Node.js - "TypeError - res.setHeader is not a function"
Both post and getJSON callbacks have same res variable name. Try this: var getJSON =require('get-json'); app.post('/json', function(req, ...
Read more >res.setHeader is not a function at FacebookStrategy.strategy ...
The issue here is that FastifyReply has a header method to set headers, but no setHeader like Express's Response . We can add...
Read more >Facing Error res.setHeader not a Function - DEV Community
Hello This is response from NodeJS>Server. ')//this method is used to display the response on the web page. res.end(). }).
Read more >Cookies | NestJS - A progressive Node.js framework
Hint The @Res() decorator is imported from the @nestjs/common , while FastifyReply from the fastify package. Creating a custom decorator (cross-platform)#. To ...
Read more >Node.js response.setHeader() Method - GeeksforGeeks
The response.setHeader(name, value) (Added in v0.4.0) method is an inbuilt application programming interface of the 'http' module which sets ...
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 FreeTop 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
Top GitHub Comments
It works correctly with the fastify adapter. This library doesn’t actually make any calls to
setHeader
on the response, so I think that your problem is coming from your application code or perhaps nextjs. Whre does the stacktrace say that the setHeader call is?