francescov1 / mongoose-tsgen

A plug-n-play Typescript generator for Mongoose.
102 stars 24 forks source link

Error: Debug Failure. Output generation failed #110

Closed rakakhrl closed 1 year ago

rakakhrl commented 1 year ago

Hey, I don't know if the issue is with me or the package but every time I tried to re-generate my schema I got this error Error: Debug Failure. Output generation failed.

It always work as intended the first time as long as I'm not modifying the schema, but if I had some changes to the schema (adding new field or changing the type) it failed to generate the new schema.

I already try to delete the previously generated file, clear cache, remove not yet exist import to the generated file its still failing. The only way I could make it work if I create completely new project and generate my new schema there but even then if I modify it again it will fail with the same error.

This is my first time using this package and working with typescript so any help would be really appreciated.

Oh and one more thing, I'm using NestJS as the framework.

rakakhrl commented 1 year ago

Found the problem. The /dist folder generated by NestJS is causing this issue, I don't exactly know why but deleting it before running npx mtgen fix the issue.