Skip to Content
PlatformsWebTroubleshooting

Troubleshooting

init() throws immediately

The CDN bundle’s init() throws [1Sygnal] apiKey is required in init(). synchronously (well, the function is async, so as a rejected Promise) if the API key is missing.

await oneSygnal.init(...) resolved immediately, but surveys aren’t showing

If you’re on the npm loader, init() returns void, not a Promise — awaiting it doesn’t wait for anything. The bundle loads asynchronously in the background; there’s no ready event on web to await instead (see Events). If you’re loading the CDN bundle directly, its init() genuinely does return Promise<void> that resolves once initialization completes — check you’re not accidentally mixing the two distribution channels.

A call I made right after init() returned undefined

If you’re on the loader, calls made before the bundle finishes loading are queued and their results are unobservable — there’s nothing yet to produce a return value. on() returns undefined instead of a Registration; areSurveysEnabled() returns undefined instead of a boolean. This is queuing behavior, not a bug — the call itself (other than reads) still gets replayed against the bundle once it’s ready.

Script tag auto-init isn’t firing

src doesn’t contain the substring 1sygnal. Auto-init only scans <script data-api-key="..."> tags whose src matches that substring. Renaming or proxying the script URL to something that doesn’t contain 1sygnal breaks auto-init with no console output.

The npm loader is also on the page. The bundle leaves starting the SDK to the loader when it finds one, so a data-api-key tag is ignored there. Use one channel, not both.

Options I passed to init() are ignored

The SDK starts once per page, so a second init() — made while the first is still running, or after it finished — doesn’t restart it, and its options never apply. Make one init() call per page. To change options at runtime, call shutdown() first.

The exception is a <script data-api-key> tag: its auto-init only knows the tag’s data-* attributes, so your first own init() call with options takes over and restarts the SDK once with them (see Install).

Bundle failed to load

If the <script> tag’s request fails (network, blocked CDN, ad blocker), the loader logs [1Sygnal] Failed to load SDK bundle from <url> to the console via console.warn and resets its internal “bundle loaded” flag, so a later init() call will retry the injection. Queued calls from before the failure remain queued.