-
-
Notifications
You must be signed in to change notification settings - Fork 21
Description
Addon
No specific addon – This bug report is related to Webtools Core
Describe the bug
Hello,
When using the router and a wrong url is requested, the plugin return a 500 error :
error: Cannot read properties of undefined (reading 'kind') TypeError: Cannot read properties of undefined (reading 'kind') at routerWithControllers (/node_modules/strapi-plugin-webtools/dist/server/index.js:696:57) at process.processTicksAndRejections (node:internal/process/task_queues:105:5) at async Object.router (/node_modules/strapi-plugin-webtools/dist/server/index.js:735:23) at async returnBodyMiddleware (/node_modules/@strapi/core/dist/services/server/compose-endpoint.js:46:20) at async policiesMiddleware (/node_modules/@strapi/core/dist/services/server/policy.js:21:9) at async /node_modules/@strapi/core/dist/services/server/compose-endpoint.js:27:20 at async serve (/node_modules/koa-static/index.js:59:5) at async returnBodyMiddleware (/node_modules/@strapi/core/dist/services/server/compose-endpoint.js:46:20) at async policiesMiddleware (/node_modules/@strapi/core/dist/services/server/policy.js:21:9) at async //node_modules/@strapi/core/dist/services/server/compose-endpoint.js:27:20
Steps to reproduce the behavior
- Activate the config option router_use_controllers
- Call api/webtools/router?path= with an unknown path
Expected behavior
We should check if strapi.contentTypes[contentType] is existing, instead thow an not found error ?
Screenshots
No response
Code snippets
Node.js version
22.21.1
Package manager
NPM
Strapi version
5.39
Plugin version
1.8.0
Database
MySQL
Operating system
macOS
Additional context
No response