Issue come on compile time:
TypeError: Cannot read property 'name' of undefined in product.schema.js:25
I think there is some async issue, When i try to initialize User Model it sees there a ref to Product model and goes to initialize Product model, but then product model point ref to user model which is not initialized yet. If I remove product: Product[] from User Model compiles successfully
How I'm able to avoid this compile time error, thanks a lot!
I have 2 schemas: User and Product, User have array of products and Product have single user. Schemas looks like:
User:
Product:
Product module:
Issue come on compile time: TypeError: Cannot read property 'name' of undefined in product.schema.js:25
I think there is some async issue, When i try to initialize User Model it sees there a ref to Product model and goes to initialize Product model, but then product model point ref to user model which is not initialized yet. If I remove product: Product[] from User Model compiles successfully
How I'm able to avoid this compile time error, thanks a lot!