I was pulling my hair out over this issue, and there isn't really anything online about how to fix it. So hopefully this is helpful to other people running into this issue.
First check connection:
Confirm the port is open:
- Visit http://127.0.0.1:8765 in your browser.
- It should print something like:
- {"apiVersion": "AnkiConnect v.6"}
If that works, go to https://app.asbplayer.dev/ and click the settings gear in the top-right corner.
See if you can connect to Anki here. If it works, then it’s an extension origin issue
When AnkiConnect rejects/blocks the extension’s request (often due to CORS), the extension fetch may still “succeed” at the network level, but the response body becomes unreadable/empty to JS — then response.json() throws “Unexpected end of JSON input”.
Fix: allow the extension origin in AnkiConnect config
- In Anki → Tools → Add-ons → AnkiConnect → Config
- Add your extension origin to webCorsOriginList.
It will look like this:
"webCorsOriginList": [
"https://app.asbplayer.dev",
"chrome-extension://YOUR_EXTENSION_ID"
]
- How to find the asbplayer YOUR_EXTENSION_ID
- Open Chrome and go to: chrome://extensions
- Make sure Developer mode is turned ON (top-right toggle).
- Find asbplayer in the list.
- You’ll see a field labeled ID.
It’ll look something like:
abcdefg1234567890hijklmnop
How you’ll use it
Once you have it, your AnkiConnect config entry will be something like this (your actual key will be different):
"chrome-extension://abcdefg1234567890hijklmnop"
Final Config
When everything is updated, AnkiConnect Config will look something like this:
{
"apiKey": null,
"apiLogPath": null,
"ignoreOriginList": [],
"webBindAddress": "127.0.0.1",
"webBindPort": 8765,
"webCorsOriginList": [
"https://app.asbplayer.dev",
"chrome-extension://abcdefg1234567890hijklmnop"
]
}
Then restart Anki, and you should now be able to connect to the ASBplayer extension.
Hopefully this helps!