-
-
Notifications
You must be signed in to change notification settings - Fork 9.2k
Closed
Labels
issue: bugIssue reporting a bugIssue reporting a bugseverity: mediumIf it breaks the basic use of the product but can be worked aroundIf it breaks the basic use of the product but can be worked aroundsource: plugin:i18nSource is plugin/i18n packageSource is plugin/i18n packagestatus: confirmedConfirmed by a Strapi Team member or multiple community membersConfirmed by a Strapi Team member or multiple community members
Description
Bug report
Describe the bug
I am running models from a plugin. I'm trying to install i18n in those models. It fails to start:
yarn workspace v1.22.4
yarn run v1.22.4
$ strapi develop
[2021-04-23T07:18:02.197Z] error Something went wrong in the model `Pages` with the attribute `localizations`
[2021-04-23T07:18:02.198Z] error TypeError: Cannot read property 'uid' of undefined
at Object.defineAssociations (/Users/laurenskling/sites/strapi/node_modules/strapi-utils/lib/models.js:389:34)
at buildRelation (/Users/laurenskling/sites/strapi/node_modules/strapi-connector-mongoose/lib/mount-models.js:438:15)
at /Users/laurenskling/sites/strapi/node_modules/strapi-connector-mongoose/lib/mount-models.js:121:7
at Array.forEach (<anonymous>)
at mountModel (/Users/laurenskling/sites/strapi/node_modules/strapi-connector-mongoose/lib/mount-models.js:120:26)
at Array.forEach (<anonymous>)
at module.exports (/Users/laurenskling/sites/strapi/node_modules/strapi-connector-mongoose/lib/mount-models.js:341:23)
at /Users/laurenskling/sites/strapi/node_modules/strapi-connector-mongoose/lib/index.js:193:16
at Array.map (<anonymous>)
at mountPlugins (/Users/laurenskling/sites/strapi/node_modules/strapi-connector-mongoose/lib/index.js:191:35)
at /Users/laurenskling/sites/strapi/node_modules/strapi-connector-mongoose/lib/index.js:155:9
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async Promise.all (index 0)
at async Object.initialize (/Users/laurenskling/sites/strapi/node_modules/strapi-database/lib/connector-registry.js:30:9)
at async DatabaseManager.initialize (/Users/laurenskling/sites/strapi/node_modules/strapi-database/lib/database-manager.js:43:5)
at async Strapi.load (/Users/laurenskling/sites/strapi/node_modules/strapi/lib/Strapi.js:354:5)
error Command failed with exit code 1.
Steps to reproduce the behavior
- create a plugin like "strapi-plugin-pages", add a model with:
"pluginOptions": {
"i18n": {
"localized": true
}
},
- install the plugin in your project
- run start
Expected behavior
i18n working from a plugin model :)
System
- Node.js version: 14.15.1
- NPM version: 6.14.11
- Strapi version: 3.6.0
- Database: atlas mongodb
- Operating system: macos
Additional context
Add any other context about the problem here.
conorjohn, wscourge, sapkra and manuel-schoebelMattieBelt, binchem, conorjohn, marcowuethrich and manuel-schoebel
Metadata
Metadata
Assignees
Labels
issue: bugIssue reporting a bugIssue reporting a bugseverity: mediumIf it breaks the basic use of the product but can be worked aroundIf it breaks the basic use of the product but can be worked aroundsource: plugin:i18nSource is plugin/i18n packageSource is plugin/i18n packagestatus: confirmedConfirmed by a Strapi Team member or multiple community membersConfirmed by a Strapi Team member or multiple community members