Open kaller01 opened 3 months ago
@kaller01 thanks for flagging this! It's definitely a hiccup we need to sort out. (I had this issue as well and made it work as you did)
I havn't really looked at the code for this issue but if you find a solution, you're more than welcome to contribute. thanks!
Hi, This is not related to this module I think. I've spend some time debugging and I've solve this issue by importing model into the place when I am referencing it in another schema. https://codingmanatee.wordpress.com/2023/07/11/mongoose-missingschemaerror-schema-hasnt-been-registered-for-model-gas/
I have two models,
Photo
which holds a reference toLocation
.With the following endpoint
this error is produced:
I the
Location
model is not directly used yet (as I am just starting the project) so I assume that thenuxt-mongoose
overlooks to register it, even though it is in fact used.The solution to get this to work for me is to just use the
Location
model, so the auto registering happens, but I don't think this behavior is intended.Other then that, I am happy to find this nuxt module exists, great work! :)