Open Teddy-Schmitz opened 1 month ago
We are also trying to use fastify-vite in production and are experiencing the exact same problem with both, version 6 and version 7 of fastify-vite. We currently fallback to version 5.. of fastify-vite with which this issue doesn't happen. However this started to block other major version updates (e.g. updating fastify to the latest major version). It would be great if someone could take a look at this!
I'll take a look now.
Prerequisites
Fastify version
4.28.1
Plugin version
6.0.7
Node.js version
20.9.0
Operating system
Linux
Operating system version (i.e. 20.04, 11.3, 10)
Arch
Description
Hello, I'm having issues getting fastify-vite to run in production mode and from what I can tell it has to do with how fastify-static is setup. Basically I have setup it very simply to grab all routes and return the client side application, this has worked fine in development mode but when I build and run it in production mode I get the below error.
I'm not sure if there is something I can do to fix this on my side, all the examples use "/" as the main route but that doesn't work properly for a client side application I want all routes (not already defined) to load the client side app. I saw this config referenced in another issue so I copied it from there.
Link to code that reproduces the bug
No response
Expected Behavior
Fastify starts normally