TypeScript error
See original GitHub issue🐛 Bug Report
It is clear that that are types for fastify-nextjs and from what I can tell the types look ok with a ‘next’ method being applied to fastify. The problem is that it is not being applied properly in my relatively simple application.
To Reproduce
Steps to reproduce the behavior:
import fastify, { RequestGenericInterface } from "fastify";
import fastifyNext from 'fastify-nextjs';
const app = fastify({ logger: true })
.register(fastifyNext)
.after(() => {
fastify.next('/hello')
});
Expected behavior
I expect there not to be a typescript error that says
Property 'next' does not exist on type '{ <Server extends Http2SecureServer, Request extends RawRequestDefaultExpression<Server> = RawRequestDefaultExpression<Server>, Reply extends RawReplyDefaultExpression<...> = RawReplyDefaultExpression<...>, Logger extends FastifyLoggerInstance = FastifyLoggerInstance>(opts: FastifyHttp2SecureOptions<...>): FastifyIn...'.ts(2339)
Your Environment
- node version: 12
- fastify version: >=2.0.0
- os: Mac
- ts-node
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Documentation - Understanding Errors - TypeScript
Whenever TypeScript finds an error, it tries to explain what went wrong in as much detail as possible. Because its type system is...
Read more >Get a catch block error message with TypeScript - Kent C. Dodds
TypeScript forces you to acknowledge you can't know what was thrown making getting the error message a pain. Here's how you can manage...
Read more >Error - JavaScript - MDN Web Docs - Mozilla
Error objects are thrown when runtime errors occur. The Error object can also be used as a base object for user-defined exceptions.
Read more >Exception Handling - TypeScript Deep Dive - Gitbook
Creates an instance representing an error that occurs when a numeric variable or parameter is outside of its valid range.
Read more >TypeScript errors and how to fix them
TypeScript errors and how to fix them. Common Errors. Below you find a list of common TypeScript errors along with the buggy code...
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
Yeah that’s true it was not a bug. Thanks for the help @KiraPC 🔥🔥
Closing for @KiraPC answer.