blomqma / next-rest-framework

Type-safe, self-documenting APIs for Next.js
https://next-rest-framework.vercel.app
Other
136 stars 18 forks source link

Error: Next REST Framework config not found. Initialize a docs handler to generate the OpenAPI spec. #123

Closed WillGarman closed 7 months ago

WillGarman commented 7 months ago

I am using Windows 11 and even when using the next-rest-framework example repository, after going through the installations. When I run

Any sort of generate command (Including in my personal project), fails with the error:

Compiling endpoints...
Generating OpenAPI spec...
Next REST Framework config not found. Initialize a docs handler to generate the OpenAPI spec.

I also tried to setting the api path using: next-rest-framework generate --configPath /api and got this error

Compiling endpoints...
Generating OpenAPI spec...
A `configPath` parameter with a value of /api was provided but no Next REST Framework configs were found.

Havent seen any open questions or docs covering this so, open to any and all ideas!

Ps: this is working perfectly fine for the macOS and linux folks

WillGarman commented 7 months ago

I ended up downloading WSL2 (linux distro for windows guide here)

It is working. But still was not working before i started a linux distro

blomqma commented 7 months ago

Ah, classic. I did some testing on Windows platform and was able to reproduce this. Basically some dynamic file imports were not working as the file URLs were not resolved correctly on Windows systems causing the CLI commands not to work. This has been addressed in v5.1.0 so I kindly ask you to upgrade to that version and see if you're problem is gone, thanks for reporting the problem.