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

ApolloClient 500 error #47

Closed
bnbabu55 opened this issue Feb 11, 2021 · 2 comments
Closed

ApolloClient 500 error #47

bnbabu55 opened this issue Feb 11, 2021 · 2 comments

Comments

@bnbabu55
Copy link

bnbabu55 commented Feb 11, 2021

I am following your tutorial and trying to build a site with NextJS and Wordpress as backend. I have my Wordpress site setup else where, so I am using only your frontend folder, copied contents of this folder to my local project directory and changed settings to meet my needs.

When I try yarn dev, I get 500 status code from ApolloClient, following is what I see in VS Code terminal.

https://circlej.smr-sandbox.com/graphql
ApolloError: Response not successful: Received status code 500
at new ApolloError (C:\Babu\Learning\NextJs\CircleJ2\node_modules@apollo\client\errors\errors.cjs.js:31:28)
at C:\Babu\Learning\NextJs\CircleJ2\node_modules@apollo\client\core\core.cjs.js:1457:19
at C:\Babu\Learning\NextJs\CircleJ2\node_modules@apollo\client\utilities\utilities.cjs.js:936:69
at new Promise ()
at Object.error (C:\Babu\Learning\NextJs\CircleJ2\node_modules@apollo\client\utilities\utilities.cjs.js:936:21)
at notifySubscription (C:\Babu\Learning\NextJs\CircleJ2\node_modules\zen-observable\lib\Observable.js:140:18)
at onNotify (C:\Babu\Learning\NextJs\CircleJ2\node_modules\zen-observable\lib\Observable.js:179:3)
at SubscriptionObserver.error (C:\Babu\Learning\NextJs\CircleJ2\node_modules\zen-observable\lib\Observable.js:240:7)
at C:\Babu\Learning\NextJs\CircleJ2\node_modules@apollo\client\utilities\utilities.cjs.js:924:68
at Array.forEach () {
graphQLErrors: [],
networkError: Error [ServerError]: Response not successful: Received status code 500
at Object.throwServerError (C:\Babu\Learning\NextJs\CircleJ2\node_modules@apollo\client\link\utils\utils.cjs.js:45:17)
at C:\Babu\Learning\NextJs\CircleJ2\node_modules@apollo\client\link\http\http.cjs.js:31:19
at runMicrotasks ()
at processTicksAndRejections (node:internal/process/task_queues:93:5) {
response: Response {
size: 0,
timeout: 0,
[Symbol(Body internals)]: [Object],
[Symbol(Response internals)]: [Object]
},
statusCode: 500,
result: {
code: 'internal_server_error',
message: '

There has been a critical error on this website.

Learn more about debugging in WordPress.

',
data: [Object],
additional_errors: []
}
},
extraInfo: undefined
}
event - build page: /[...slug]
wait - compiling...
event - compiled successfully
https://circlej.smr-sandbox.com/graphql
https://circlej.smr-sandbox.com/graphql
Error: Response not successful: Received status code 500
at new ApolloError (C:\Babu\Learning\NextJs\CircleJ2\node_modules@apollo\client\errors\errors.cjs.js:31:28)
at C:\Babu\Learning\NextJs\CircleJ2\node_modules@apollo\client\core\core.cjs.js:1457:19
at C:\Babu\Learning\NextJs\CircleJ2\node_modules@apollo\client\utilities\utilities.cjs.js:936:69
at new Promise ()
at Object.error (C:\Babu\Learning\NextJs\CircleJ2\node_modules@apollo\client\utilities\utilities.cjs.js:936:21)
at notifySubscription (C:\Babu\Learning\NextJs\CircleJ2\node_modules\zen-observable\lib\Observable.js:140:18)
at onNotify (C:\Babu\Learning\NextJs\CircleJ2\node_modules\zen-observable\lib\Observable.js:179:3)
at SubscriptionObserver.error (C:\Babu\Learning\NextJs\CircleJ2\node_modules\zen-observable\lib\Observable.js:240:7)
at C:\Babu\Learning\NextJs\CircleJ2\node_modules@apollo\client\utilities\utilities.cjs.js:924:68
at Array.forEach () {
type: 'ApolloError',
graphQLErrors: [],
networkError: {
name: 'ServerError',
response: { size: 0, timeout: 0 },
statusCode: 500,
result: {
code: 'internal_server_error',
message: '

There has been a critical error on this website.

Learn more about debugging in WordPress.

',
data: [Object],
additional_errors: []
}
}
}

Then on a hunch I went ahead and typed https://circlej.smr-sandbox.com/graphql endpoint in the browser get an error, looks like wp-graphql-gutenberg-0.3.7 is having problems, have you seen this error?

Fatal error: Uncaught WPGraphQLGutenberg\Blocks\RegistryNotSourcedException: Client side block registry is missing. You need to open up gutenberg or load it from WPGraphQLGutenberg Admin page. in /home/customer/www/circlej.smr-sandbox.com/public_html/wp-content/plugins/wp-graphql-gutenberg-0.3.7/src/Blocks/Registry.php:41 Stack trace: #0 /home/customer/www/circlej.smr-sandbox.com/public_html/wp-content/plugins/wp-graphql-gutenberg-0.3.7/src/Schema/Types/BlockTypes.php(253): WPGraphQLGutenberg\Blocks\Registry::get_registry() #1 /home/customer/www/circlej.smr-sandbox.com/public_html/wp-includes/class-wp-hook.php(287): WPGraphQLGutenberg\Schema\Types\BlockTypes->WPGraphQLGutenberg\Schema\Types{closure}(Object(WPGraphQL\Registry\TypeRegistry)) #2 /home/customer/www/circlej.smr-sandbox.com/public_html/wp-includes/class-wp-hook.php(311): WP_Hook->apply_filters(NULL, Array) #3 /home/customer/www/circlej.smr-sandbox.com/public_html/wp-includes/plugin.php(484): WP_Hook->do_action(Array) #4 /home/customer/www/circlej.smr-sandbox.c in /home/customer/www/circlej.smr-sandbox.com/public_html/wp-content/plugins/wp-graphql-gutenberg-0.3.7/src/Blocks/Registry.php on line 41

Thanks for any help.

@bnbabu55 bnbabu55 changed the title ApolloClient error ApolloClient 500 error Feb 11, 2021
@imranhsayed
Copy link
Owner

Please click on Update Block Registry in Wp dashboard GraphQL Gutenberg and if still does not work, ensure you have latest version of WordPress plugins

@bnbabu55
Copy link
Author

I clicked on update Block registry as you suggested and it worked like magic. Thanks a lot for the timely help. Will continue to explore your tutorial.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants