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

ApolloError: Unexpected token '<' #120

Open
pdenissen opened this issue Nov 25, 2022 · 1 comment
Open

ApolloError: Unexpected token '<' #120

pdenissen opened this issue Nov 25, 2022 · 1 comment

Comments

@pdenissen
Copy link

Hi there,

Today I'm installing this theme for learning about querying Wordpress as a newbie at Next.
Now I'm getting this error below. Any idea what is going wrong or where to look at?

wait  - compiling...
event - compiled successfully
event - build page: /next/dist/pages/_error
wait  - compiling...
event - compiled successfully
error - ApolloError: Unexpected token '<', "<!DOCTYPE "... is not valid JSON
    at new ApolloError (/Users/pierredenissen/Domains/woo-next/node_modules/@apollo/client/errors/errors.cjs.js:31:28)
    at /Users/pierredenissen/Domains/woo-next/node_modules/@apollo/client/core/core.cjs.js:1493:19
    at both (/Users/pierredenissen/Domains/woo-next/node_modules/@apollo/client/utilities/utilities.cjs.js:963:53)
    at /Users/pierredenissen/Domains/woo-next/node_modules/@apollo/client/utilities/utilities.cjs.js:956:72
    at new Promise (<anonymous>)
    at Object.then (/Users/pierredenissen/Domains/woo-next/node_modules/@apollo/client/utilities/utilities.cjs.js:956:24)
    at Object.error (/Users/pierredenissen/Domains/woo-next/node_modules/@apollo/client/utilities/utilities.cjs.js:964:49)
    at notifySubscription (/Users/pierredenissen/Domains/woo-next/node_modules/zen-observable/lib/Observable.js:140:18)
    at onNotify (/Users/pierredenissen/Domains/woo-next/node_modules/zen-observable/lib/Observable.js:179:3)
    at SubscriptionObserver.error (/Users/pierredenissen/Domains/woo-next/node_modules/zen-observable/lib/Observable.js:240:7) {
  graphQLErrors: [],
  networkError: SyntaxError [ServerParseError]: Unexpected token '<', "<!DOCTYPE "... is not valid JSON
      at JSON.parse (<anonymous>)
      at /Users/pierredenissen/Domains/woo-next/node_modules/@apollo/client/link/http/http.cjs.js:18:25
      at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
    response: Response {
      size: 0,
      timeout: 0,
      [Symbol(Body internals)]: [Object],
      [Symbol(Response internals)]: [Object]
    },
    statusCode: 404,
    bodyText: '<!DOCTYPE html>\n' +

Thanks for the help!

@imlouisblanco
Copy link

Hi! I had the same issue, you have to install the last WooGraphQL plugin version: https://github.com/wp-graphql/wp-graphql-woocommerce/releases/tag/v0.12.0

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