WCPOS FAQ
  • Introduction
  • Hardware
    • What credit card readers are compatible with WooCommerce POS?
    • What receipt printers are compatible with WooCommerce POS?
    • What barcode scanners are compatible with WooCommerce POS?
  • Display
    • Which browsers are compatible with WooCommerce POS?
    • How do I get taxes to show in the POS?
    • Why aren’t my product images showing?
    • Why aren’t my products showing?
    • How do I clear the local data?
  • Error Messages
    • Why am I getting a 404 Error – Page Not Found?
    • Why am I getting a Time Out error?
    • Why am I getting a SyntaxError?
    • Why am I getting a 500 Internal Server Error?
    • Why am I getting an IndexedDB Error?
    • Why am I getting an Exceeded Quota Error?
  • Integrations
    • Which payment gateways are compatible with WooCommerce POS?
  • Settings
    • Why aren't my settings saving?
Powered by GitBook
On this page
  • Unexpected token in JSON
  • Unexpected end of input

Was this helpful?

  1. Error Messages

Why am I getting a SyntaxError?

If a server response is not valid JSON, WooCommerce POS will throw a SyntaxError.

PreviousWhy am I getting a Time Out error?NextWhy am I getting a 500 Internal Server Error?

Last updated 4 years ago

Was this helpful?

WooCommerce POS communicates with the 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

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. 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.

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

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.

Copy the error notice and contact

Example of SyntaxError modal - Unexpected end

This occurs if the is disabled. In order to see the error message you should temporarily enable error reporting by setting to true in your wp-config.php file.

support@wcpos.com
PHP error_reporting
WP_DEBUG
WooCommerce REST API