You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When trying to create a relationship with core entity ProductCollection in a custom module (collection_image), the ORM throws a discovery error during migration generation:
error: Entity 'ProductCollection' was not discovered... (used in CollectionImage.product_collection_id)
You cannot create a DB relationship between models from two different modules. Here, you would need to use our Linking API to associate the image with the existing Product Collection: https://docs.medusajs.com/learn/fundamentals/module-links
Package.json file
Node.js version
v22.12.0
Database and its version
PostgreSQL 15.10
Operating system name and version
Windows 10 Pro
Browser name
No response
What happended?
When trying to create a relationship with core entity ProductCollection in a custom module (collection_image), the ORM throws a discovery error during migration generation:
Expected behavior
Core entities like ProductCollection should be discoverable by the ORM when imported correctly, allowing relationships in custom modules.
Actual behavior
ORM fails to recognize ProductCollection even with direct import from @medusajs/product/dist/models, indicating a module discovery issue.
Link to reproduction repo
https://github.com/tolgaand/isanore-shop
The text was updated successfully, but these errors were encountered: