danestves / danestves/strapi-plugin-preview-content

Error: The model user can't be found.

Open
#29 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
JavaScript
Stars
63
Forks
26
PR merge metrics
No merged PRs in 30d

Description

When navigating to the `Users` entry generated by the strapi users and permissions plugin in the `Collection Types` menu, the following error is logged:

```
error Error: The model user can't be found.
at DatabaseManager.query (/srv/app/node_modules/strapi-database/lib/database-manager.js:79:13)
at Strapi.query (/srv/app/node_modules/strapi/lib/Strapi.js:485:20)
at Object. (/srv/app/node_modules/strapi-plugin-preview-content/services/preview.js:89:71)
at step (/srv/app/node_modules/strapi-plugin-preview-content/services/preview.js:44:23)
at Object.next (/srv/app/node_modules/strapi-plugin-preview-content/services/preview.js:25:53)
at /srv/app/node_modules/strapi-plugin-preview-content/services/preview.js:19:71
at new Promise ()
at __awaiter (/srv/app/node_modules/strapi-plugin-preview-content/services/preview.js:15:12)
at Object.isPreviewable (/srv/app/node_modules/strapi-plugin-preview-content/services/preview.js:85:16)
at Object. (/srv/app/node_modules/strapi-plugin-preview-content/controllers/preview.js:60:54)
at step (/srv/app/node_modules/strapi-plugin-preview-content/controllers/preview.js:33:23)
at Object.next (/srv/app/node_modules/strapi-plugin-preview-content/controllers/preview.js:14:53)
at /srv/app/node_modules/strapi-plugin-preview-content/controllers/preview.js:8:71
at new Promise ()
at __awaiter (/srv/app/node_modules/strapi-plugin-preview-content/controllers/preview.js:4:12)
at Object.isPreviewable (/srv/app/node_modules/strapi-plugin-preview-content/controllers/preview.js:54:16)
```

Note that it does not beak the app, it is invisible on frontend, it is just visible in server traces.

Contributor guide

Open the contributing guide

Research direction

Reproduce the error by opening the Users entry under Collection Types. Start with strapi-plugin-preview-content/services/preview.js, especially isPreviewable, and follow its call from controllers/preview.js; verify the navigation no longer logs the missing-model error while the app and frontend behavior remain unchanged.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.