Errors & Validation
The plugin never breaks the host page. Problems show up in two places:
- Inside the plugin, in place of its content, for anything that stops it from loading.
- In the browser console, prefixed with
[SportNinja], for mistakes in your code that the plugin can work around.
Shown in the Plugin
Section titled “Shown in the Plugin”Configuration Problems
Section titled “Configuration Problems”The plugin lists every problem it found, one per line, then stops. Fix them all and reload.
| Message | Fix |
|---|---|
orgId is required when view is "organization" |
Add the ID that matches view: orgId, competitionId or teamId. |
competitionId must be an id like WHywmDqtc5b9fKmd |
IDs are letters, digits, - and _ only. Copy it again from the SportNinja address. |
theme.primary must be a 6-digit hex colour like #F2B400 |
Use #RRGGBB. No shorthand, names or rgb(). |
theme.fontFamily must be a font name like Open Sans |
The Google Fonts family name only, no CSS fallbacks or quotes. |
theme.fontSize must be at most 22 |
Keep numbers in range; see the Theme Reference. |
display.footer.link must be an https link like https://example.com |
Footer links must be https://. |
theme Unrecognized key(s) in object: 'primaryColor' |
A typo or an option that doesn’t exist inside theme, tabs or display. Check the spelling against the reference. |
The embed has no plugin key. Add key: "pk_<brand>_…" to the snippet. |
Add key. |
key must look like pk_<brand>_… |
The key was cut short or mistyped. Copy it again. |
cfg is larger than 4 KB |
The configuration is unusually large. Remove options you don’t need. |
“This Plugin Isn’t Set Up for This Website”
Section titled ““This Plugin Isn’t Set Up for This Website””The key was rejected:
- The website isn’t on the key. The address in the browser, scheme and
www.included, must be one of the key’s hosted websites. Ask the league to add it.https://yourleague.comandhttps://www.yourleague.comare different websites; so is eachhttp://localhost:<port>. - The key was revoked or mistyped. Ask the league for a current key.
- Hidden page address. Some site builders (GoDaddy, for example) load pages in a way that hides the address from the plugin. The league can turn on Allow Hidden Website Addresses for the key.
“This Subscription Doesn’t Include the Website Plugin”
Section titled ““This Subscription Doesn’t Include the Website Plugin””The league’s plan doesn’t include the plugin. It’s part of the Pro and Ultimate plans; the league can upgrade.
Console Warnings
Section titled “Console Warnings”The plugin still loads, but part of your code had no effect:
| Warning | Meaning |
|---|---|
Unknown option "…" was ignored. |
A top-level option that doesn’t exist (often a typo, like orgID). |
mount: no element matches "#…". |
The target wasn’t in the page when mount ran. Mount after the element exists. |
mount: this element already has a SportNinja plugin. |
Mounted twice on the same element. unmount first. |
syncUrl: only the first plugin on a page can sync the URL. |
A second plugin asked for syncUrl: true; it was turned off for that plugin. |
update: "…" can't change after mount and was ignored. |
Only theme, tabs and display can be updated. unmount and mount again for the rest. |
update: this page has several plugins; pass the element or selector first. |
With more than one plugin, name the target: ['update', '#id', {…}]. |
on: unknown event "…". |
Events are ready, signin, signout and registration:completed. |
Testing Locally
Section titled “Testing Locally”- Ask the league to add your local address, e.g.
http://localhost:3000, to the key’s hosted websites. - Load your page and open the browser console. Any
[SportNinja]warnings point at the exact problem. - Change one option at a time; a configuration problem names the option that’s wrong.