strapi-community / strapi-plugin-slugify

A plugin for Strapi Headless CMS that provides the ability to auto slugify a field for any content type.
https://market.strapi.io/plugins/strapi-plugin-slugify
MIT License
45 stars 21 forks source link

Strapi can't start up with plugin slugify #45

Closed Gradlon closed 2 years ago

Gradlon commented 2 years ago

Hi, Strapi crashes as son as I enable the Plugin. The command yarn dev lead to a crash with the following error: error: Cannot read property 'admin::permission' of undefined TypeError: Cannot read property 'admin::permission' of undefined

graphql: { enabled: true, config: { endpoint: '/graphql', shadowCRUD: true, playgroundAlways: false, depthLimit: 7, amountLimit: 100, apolloServer: { tracing: false, }, }, }, slugify: { enabled: false, config: { contentTypes: { page: { field: 'slug', references: 'title', }, }, }, }, Using Node 14 "@strapi/plugin-graphql": "^4.1.5", "strapi-plugin-slugify": "^2.2.1" "@strapi/strapi": "4.1.5",

When GraphQL is Disabled it works.

ComfortablyCoding commented 2 years ago

@Gradlon , thank you for the report. That is my bad, the Additional Requirement for GraphQL should state that the slugify configuration should be before the graphql plugin configuration not after it.

Updating the plugins.js order to

// ...
slugify: { 
  enabled: false, 
  config: { contentTypes: { page: { field: 'slug', references: 'title', },
}
graphql: { 
  enabled: true, 
  config: { 
    endpoint: '/graphql', 
    shadowCRUD: true,
    playgroundAlways: false, 
    depthLimit: 7, 
    amountLimit: 100,
    apolloServer: { tracing: false, },
   }, 
}
//..

should fix the issue.

P.S. Leaving this open until a fix is applied.