Identifying Console Errors with Clerk.io
When setting up Clerk.io you might run into problems, for a number of different reasons.
The most common problem is that you have installed Clerk.io, but products are still not being shown.
This article shows you the messages that Clerk.io shows in the console and explains how to deal with them to help you when debugging.
Checking your browsers console
If Clerk.io encounters an error, and we know what the error is, you will see a message in your console:
By clicking the error link you will get more information about what went wrong, which you can use to debug the error yourself, or to send to our support team who will help you out.
These are the most common errors from the console:
1. “LogicalError: Unknown content ‘insert-name’”
This error will show if the embedcode you inserted is referencing a Website Content that does not exist, in data-template.
To fix it, make sure that the name in the embedcode matches a Website Content.
You can always click Edit Content for any Content, to see what the embedcode should be:
2. “AuthenticationError: Invalid API endpoint”
This error normally happens if you have used the class “clerk” in your HTML somewhere:
The class “clerk” is reserved for use with our embedcodes, as its used to handle the calls to our server.
To fix it, make sure that you name the class something else, for example “clerk-product” or similar.
3. “ParsingError: Invalid type of argument product”
This error means that the ID supplied for a product in the embedcode, has a wrong type or syntax.
For example, if your product-ID’s are integers they also need to be so in the embedcode. Further, its important to remember the brackets around the ID, as it needs to be a list:
<span class="clerk" data-template="@product-page" data-products=""></span>
4. “ParsingError: Invalid type of argument category”
As with the above, this means that the ID supplied for a category is wrong.
In most cases, it happens if the placeholder in the category embedcode has not been replaced by an actual ID:
<span class="clerk" data-template="@category-page" data-category="INSERT_CATEGORY_ID"></span>
The output of the code should contain the ID of the category, like so:
<span class="clerk" data-template="@category-page" data-category="257"></span>
To fix this, select your shop system in the drop down menu in Edit content->Insert into website before copying the embed code:
The embed code will then change to include your platforms logic to select the correct category ID:
In custom setups you will however need to set your own logic in the embed code.
5. “AuthenticationError: Incorrect public API key”
This error will show if the public API key you have provided, does not match any account in Clerk.io:
To fix this, first login to my.clerk.io, and go to Settings -> API Keys
Here you can check the Public API Key and make sure that this is the key you have used in your Clerk.io tracking script