VirtusLab-Open-Source / strapi-plugin-comments

A plugin for Strapi Headless CMS that provides end to end comments feature with their moderation panel, bad words filtering, abuse reporting and more.
MIT License
407 stars 63 forks source link

Server can not start after installing plugin - incompatibility with strapi-plugin-graphql #72

Closed anatintescu closed 2 years ago

anatintescu commented 2 years ago

Hi!

After adding the plugin, I get the following error when trying to start the server:

$ strapi develop [2021-09-14T16:24:34.575Z] debug ⛔️ Server wasn't able to start properly. [2021-09-14T16:24:34.576Z] error GraphQLError: Syntax Error: Expected Name, found "}". at syntaxError (/Users/ana/Projects/Sessions/backend/app/node_modules/graphql/error/syntaxError.js:15:10) at Parser.expectToken (/Users/ana/Projects/Sessions/backend/app/node_modules/graphql/language/parser.js:1413:40) at Parser.parseName (/Users/ana/Projects/Sessions/backend/app/node_modules/graphql/language/parser.js:98:22) at Parser.parseFieldDefinition (/Users/ana/Projects/Sessions/backend/app/node_modules/graphql/language/parser.js:879:21) at Parser.optionalMany (/Users/ana/Projects/Sessions/backend/app/node_modules/graphql/language/parser.js:1503:28) at Parser.parseFieldsDefinition (/Users/ana/Projects/Sessions/backend/app/node_modules/graphql/language/parser.js:868:17) at Parser.parseObjectTypeDefinition (/Users/ana/Projects/Sessions/backend/app/node_modules/graphql/language/parser.js:812:23) at Parser.parseTypeSystemDefinition (/Users/ana/Projects/Sessions/backend/app/node_modules/graphql/language/parser.js:708:23) at Parser.parseDefinition (/Users/ana/Projects/Sessions/backend/app/node_modules/graphql/language/parser.js:150:23) at Parser.many (/Users/ana/Projects/Sessions/backend/app/node_modules/graphql/language/parser.js:1523:26) at Parser.parseDocument (/Users/ana/Projects/Sessions/backend/app/node_modules/graphql/language/parser.js:115:25) at Object.parse (/Users/ana/Projects/Sessions/backend/app/node_modules/graphql/language/parser.js:31:17) at Object.addPolymorphicUnionType (/Users/ana/Projects/Sessions/backend/app/node_modules/strapi-plugin-graphql/services/type-builder.js:188:8) at Object.generateSchema (/Users/ana/Projects/Sessions/backend/app/node_modules/strapi-plugin-graphql/services/schema-generator.js:43:35) at Object.initialize (/Users/ana/Projects/Sessions/backend/app/node_modules/strapi-plugin-graphql/hooks/graphql/index.js:76:74) at /Users/ana/Projects/Sessions/backend/app/node_modules/strapi/lib/hooks/index.js:37:28

Please find below the package.json depencencies object:

"dependencies": { "jose": "^3.12.3", "knex": "<0.20.0", "pg": "latest", "sharp": "^0.29.1", "strapi": "3.6.8", "strapi-admin": "3.6.8", "strapi-connector-bookshelf": "3.6.8", "strapi-plugin-ckeditor5": "^1.11.0", "strapi-plugin-comments": "^1.0.2", "strapi-plugin-content-manager": "3.6.8", "strapi-plugin-content-type-builder": "3.6.8", "strapi-plugin-email": "3.6.8", "strapi-plugin-graphql": "3.6.8", "strapi-plugin-meilisearch": "^0.3.2", "strapi-plugin-upload": "3.6.8", "strapi-plugin-users-permissions": "3.6.8", "strapi-provider-upload-google-cloud-storage": "^3.6.5", "strapi-utils": "3.6.8" },

I tried to add the plugin on an empty Strapi solution. It works fine until I add strapi-plugin-graphql.

natanaelsimoes commented 2 years ago

+1

cyp3rius commented 2 years ago

We're investigating.

Kronos66 commented 2 years ago

Hi @anatintescu @natanaelsimoes I found the source of problems :) (we have to update the documentation), when I added support GQL I added configuration to add dynamic content types to support GQL, to resolve this problems you need add in configurations in ./config/plugins.js example:

module.exports = {
  comments: {
    relatedContentTypes: {
      articles: {},
    },
  },
};

where comments will be related to articles, I can't add this dynamic based on model configuration because strapi does not always have here built content types :( - inconsistent

dennis-hh commented 2 years ago

I am facing the same issue. I used version 1.0.1. Now with 1.0.2, I can't start the server anymore. Something I didn't expect when updating on patch-level.