# Why am I getting a SyntaxError?

WooCommerce POS communicates with the [WooCommerce REST API](http://woothemes.github.io/woocommerce-rest-api-docs/) using JSON. If you are seeing a SyntaxError it means that the POS was expecting valid JSON but got something else instead, usually an error message from WordPress.

## Unexpected token in JSON

Clicking on the 'i' info icon will display the raw output from the server. In the example below, we can see there is a PHP Notice from WordPress. The notice references the line of code which is causing the problem.

![Example of SyntaxError modal - Unexpected token](https://wcpos.com/wp-content/uploads/2016/06/syntax-error-unexpected-token-in-json.png)

In the above example you can see that the error occurs in the `example-plugin/example.php` file at `line 15`. If you are seeing a similar error to the example above, please do the following:

1. If possible, deactivate the plugin causing the error, this will allow you to continue using WooCommerce POS
2. Copy the error notice and contact <support@wcpos.com>
3. Also contact the developer of the plugin causing the error, they are usually in the best place to provide a fix

## Unexpected end of input

In some cases the server will return nothing at all, this results in an `Unexpected end of input` with no extra information.

![Example of SyntaxError modal - Unexpected end](https://wcpos.com/wp-content/uploads/2016/06/syntax-error-unexpected-end.png)

This occurs if the [PHP error\_reporting](http://php.net/manual/en/function.error-reporting.php) is disabled. In order to see the error message you should temporarily enable error reporting by setting [`WP_DEBUG`](https://codex.wordpress.org/WP_DEBUG) to `true` in your `wp-config.php` file.

```php
// Enable debugging
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_DISPLAY', true );
```

{% hint style="danger" %}
You should only enable debugging for the time it takes to copy the error message. Debugging should not be enabled on a live site as it can produce unexpected errors and could potentially be a security risk.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://faq.wcpos.com/error-messages/syntax-error.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
