Closed AnzeKop closed 3 months ago
Thanks for reporting,
Can you provide a repository that reproduces the bug as indicated, please? This helps us to investigate on a concrete basis.
Do you know if this bug has been introduced recently? Does it work with previous patches and/or minors?
@AnzeKop
Is this still an issue?
@jean-michelet,
This has been fixed. It turned out that even if dirNameRoutePrefix was set to true when there we no autohooks.ts files it preffer the autoPrefix export but as soon as I gave it a an autohooks.ts it was going off dirNameRoutePrefix and changing all of my endpoints. I turned that to false and it then worked as expected.
I had autohooks and cascade hooks turned on in the config
Prerequisites
Fastify version
4.28.1
Plugin version
5.8.2
Node.js version
20
Operating system
macOS
Operating system version (i.e. 20.04, 11.3, 10)
Sonoma
Description
If you have a folder structure where you have a parent folder with just an autohooks.ts and then subfolders with routes.ts the routes in the child folders will not work unless you create an empty routes.ts file in the parent folder.
If you don't add an autohooks.ts file then it also works just fine but if you have a (protected) folder and just want to have an autohooks in there for validation the subsequent routes won't register unless you add an empty routes.ts file.
Link to code that reproduces the bug
No response
Expected Behavior
No response