Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
anatintescu opened this issue Sep 14, 2021 · 4 comments · Fixed by #77
Closed
Assignees
Labels
bug Something isn't working investigation Issue under investigation

Comments

@anatintescu
Copy link

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
Copy link

+1

@cyp3rius cyp3rius added bug Something isn't working investigation Issue under investigation labels Sep 15, 2021
@cyp3rius
Copy link
Collaborator

We're investigating.

@Kronos66
Copy link
Contributor

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
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working investigation Issue under investigation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants