Open sergheiCovali opened 11 months ago
Hi @sergheiCovali This extension portion of your code looks okay. Can you provide more details from your package.json
and config/plugins.js
? The error suggests the MenuItem
content type isn't registered with Strapi but it should be.
I've added strapi-server.js in src/extensions/menus/
// ./src/extensions/menus/strapi-server.js` "use strict";
module.exports = (plugin) => { // Get current
MenuItem
attributes. const defaultAttrs = plugin.contentTypes["'menu-item'"].schema.attributes;// Define custom attributes for
MenuItem
the same way they would be defined // on any other schema. const customAttrs = { short_description: { type: "string", }, };// Extend the
MenuItem
content type with custom attributes. plugin.contentTypes["'menu-item'"].schema.attributes = { ...defaultAttrs, ...customAttrs, };return plugin; };
after this when I run -> npm run develop strapi I get this error
TypeError: Cannot read properties of undefined (reading 'schema') ││ at module.exports (/Users..../../../../src ││ /extensions/menus/strapi-server.js:6:58) ││ at applyUserExtension