medusajs / medusa

Building blocks for digital commerce
https://medusajs.com
MIT License
23.88k stars 2.32k forks source link

Error when notifications are triggered #7352

Open darkcherrycreative opened 2 months ago

darkcherrycreative commented 2 months ago

System information

Medusa version (including plugins):1.10.0 Node.js version: 18.17 Database: postgres 15 Operating system: ubuntu (WSL)

Steps to reproduce the behavior

An event is fired and the following message appears on the terminal:

EntityPropertyNotFoundError: Property "valid_for" was not found in "DiscountRule". Make sure your query is correct. at /mnt/g/xampp/htdev//node_modules/typeorm/query-builder/SelectQueryBuilder.js:2270:23 at Array.forEach () at SelectQueryBuilder.buildRelations (/mnt/g/xampp/htdev//node_modules/typeorm/query-builder/SelectQueryBuilder.js:2262:32) at /mnt/g/xampp/htdev//node_modules/typeorm/query-builder/SelectQueryBuilder.js:2305:26 at Array.forEach () at SelectQueryBuilder.buildRelations (/mnt/g/xampp/htdev//node_modules/typeorm/query-builder/SelectQueryBuilder.js:2262:32) at /mnt/g/xampp/htdev//node_modules/typeorm/query-builder/SelectQueryBuilder.js:2305:26 at Array.forEach () at SelectQueryBuilder.buildRelations (/mnt/g/xampp/htdev//node_modules/typeorm/query-builder/SelectQueryBuilder.js:2262:32) at SelectQueryBuilder.applyFindOptions (/mnt/g/xampp/htdev//node_modules/typeorm/query-builder/SelectQueryBuilder.js:1758:22) at SelectQueryBuilder.setFindOptions (/mnt/g/xampp/htdev//node_modules/typeorm/query-builder/SelectQueryBuilder.js:71:14) at EntityManager.find (/mnt/g/xampp/htdev//node_modules/typeorm/entity-manager/EntityManager.js:522:14) at Repository.find (/mnt/g/xampp/htdev//node_modules/typeorm/repository/Repository.js:197:29) at Repository. (/mnt/g/xampp/htdev//node_modules/@medusajs/medusa/dist/repositories/order.js:125:68) at step (/mnt/g/xampp/htdev//node_modules/@medusajs/medusa/dist/repositories/order.js:33:23) at Object.next (/mnt/g/xampp/htdev/***/node_modules/@medusajs/medusa/dist/repositories/order.js:14:53) warn: An error occured while nodemailer was processing a notification for order.updated: Property "valid_for" was not found in "DiscountRule". Make sure your query is correct.

Expected behavior

There are no discounts set up, and none were applicable to this order anyway. Event should fire and email sent.

darkcherrycreative commented 1 month ago

Update on this issue, i've just installed a fresh version of Medusa (latest) and added the nodemailer plugin.

I get the exact same error when a notification is triggered:

warn: An error occured while nodemailer was processing a notification for order.updated: Property "valid_for" was not found in "DiscountRule". Make sure your query is correct.

There is an additional warning when starting the dev environment though too, this is:

warn: The subscriber in /mnt/g/xampp/htdev/**/test-store/node_modules/medusa-plugin-nodemailer/subscribers/index.js is missing a config.

What config is this actually looking for?