We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I'm trying to integrate @fastify/vite with NestJS, but both @fastify/vite & @nestjs/platform-fastify register middie. Which leads to a crash.
middie
So far the solution I've found is to implement the following.
async function bootstrapNestJs() { const adapter = new FastifyAdapter({ logger: true }); await adapter.register(FastifyVite as any, { ... }); (adapter as any).isMiddieRegistered = true; const app = await NestFactory.create<NestFastifyApplication>( AppModule, adapter, ); const server = app.getHttpAdapter().getInstance() as any; await server.vite.ready(); await app.listen(3000); }
The simple patch would be to add an other flag to the FastifyAdapter constructor to mark middie as already registered. I can propose a PR if wanted.
FastifyAdapter
It's just an optional flag.
Required to setup Vite with NestJS.
Here's a sample project that illustrates the problem : https://github.com/ancyrweb/nestjs-react-vite-ssr Remove the line (adapter as any).isMiddieRegistered = true; in the src/main.ts file.
(adapter as any).isMiddieRegistered = true;
src/main.ts
The text was updated successfully, but these errors were encountered:
Please provide a minimum reproduction repository. You can start one by running npm init nest in your terminal
npm init nest
Sorry, something went wrong.
@micalevisk updated
Feel free to create a PR that allows passing the skipMiddie attribute to the FastifyAdapter constructor (as part of the options object)
skipMiddie
No branches or pull requests
Is there an existing issue that is already proposing this?
Is your feature request related to a problem? Please describe it
I'm trying to integrate @fastify/vite with NestJS, but both @fastify/vite & @nestjs/platform-fastify register
middie
.Which leads to a crash.
So far the solution I've found is to implement the following.
Describe the solution you'd like
The simple patch would be to add an other flag to the
FastifyAdapter
constructor to markmiddie
as already registered.I can propose a PR if wanted.
Teachability, documentation, adoption, migration strategy
It's just an optional flag.
What is the motivation / use case for changing the behavior?
Required to setup Vite with NestJS.
Repro
Here's a sample project that illustrates the problem : https://github.com/ancyrweb/nestjs-react-vite-ssr
Remove the line
(adapter as any).isMiddieRegistered = true;
in thesrc/main.ts
file.The text was updated successfully, but these errors were encountered: