strapi-community / strapi-plugin-slugify

A plugin for Strapi Headless CMS that provides the ability to auto slugify a field for any content type.

Home Page:https://market.strapi.io/plugins/strapi-plugin-slugify

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Strapi can't start up with plugin slugify

Gradlon opened this issue · comments

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.

@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.