Skip to content

TypeError: Cannot read properties of undefined (reading 'schema') #147

Open
@sergheiCovali

Description

@sergheiCovali

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions