Skip to main content

Troubleshooting and FAQ

This page collects the most common problems developers run into while building an Embedded app, with their fixes.


Installation​

npm ci uses my company registry instead of the public one​

The template does not include an .npmrc file, so a registry set in your user or global npm configuration applies. Force the public registry for the install:

npm ci --registry=https://registry.npmjs.org/

You can check the active registry with npm config get registry. To make the setting permanent for this project, add an .npmrc with registry=https://registry.npmjs.org/ to the project folder. An npm_config_registry environment variable still takes priority over that file.

npm run lint:types fails on types inside dependencies​

Make sure "skipLibCheck": true is still set in tsconfig.json and tsconfig.storybook.json. Bento's type declarations pull in a few transitive types that fail type-checking without it.

TypeScript reports TS4023 for a component that uses Stepper​

See Known limitations of hootsuite-bento.

The template has no npm run lint​

The template does not include ESLint. Use npm run lint:types to type-check and npm run format:check to check formatting, or add ESLint to your project.


The app does not load​

The app area is blank when I use the development URL​

The browser has probably rejected the dev server's self-signed certificate. The warning cannot appear inside the iframe. In the browser's developer tools, the Network tab shows the request to localhost failing with net::ERR_CERT_AUTHORITY_INVALID.

  1. Open https://localhost:8080 in a separate tab.
  2. Accept the certificate warning.
  3. Reload Hootsuite, or close and reopen the app.

The dev server creates a new certificate each time npm start runs, so repeat this after every restart. Also check that npm start is still running.

Hootsuite loads my uploaded bundle, or shows AccessDenied, instead of my development URL​

The development URL was probably not saved. The URL field shows https://localhost:8080 as a placeholder even when it is empty. If you click Save settings with the field empty, the portal confirms the save, but no URL is stored and the extension goes back to Load from uploaded bundle. If you have not uploaded a bundle yet, the app area shows an AccessDenied error.

Type the URL in the field, click Save settings, and reload the Developer Portal page to check that Load from development URL is still selected with your URL.

The app loads but stays on a blank screen or never leaves the first page​

The app waits for the host handshake (isAppReady). If it never arrives:

  • Check that HOOTSUITE_DASHBOARD_URL is exactly the origin of the dashboard you are using. The bridge ignores messages from any other origin, including a www. variant.
  • Check that you rebuilt or restarted after changing .env. HOOTSUITE_APP_ID, HOOTSUITE_DASHBOARD_URL, and BACKEND_HOST are fixed at build time.
  • Check that the page runs inside Hootsuite. Opened directly in a browser tab, the app has no host to answer the handshake.
  • Close and reopen the app. If Hootsuite cannot complete the handshake, it does not send an error to your app, so the app keeps waiting.

Hootsuite loads an old version or the wrong URL​

  • After you upload a bundle, click Save settings. Uploading alone does not change what Hootsuite loads. The portal shows "Bundle uploaded. Click Save settings to publish it." until you save.
  • To check which bundle is saved, reload the Developer Portal page. The upload area shows that a bundle already exists.
  • If Save settings is disabled in Load from uploaded bundle mode, upload app.js first. The portal keeps your saved URL until a bundle is available.
  • If saving fails, the Developer Portal shows an error message with the reason, and your values stay in the form. Fix the input (for example, use an https:// URL) and save again.
  • Avoid +, ~, ;, and ! in the development URL. They may be removed when the URL is saved.

My app does not appear in Perch​

  • Check that the extension has Perch selected as a surface. An extension with no surfaces does not appear anywhere.
  • Check that the app is installed in your Hootsuite account.
  • Open it from the Apps drawer, with the Open apps button. Other places that list installed apps, such as Installed apps in the App Directory, are not a supported way to open an Embedded app.
  • Connect at least one social account. Perch does not show the calendar, or its apps drawer, until you do.

Perch shows a different name for my app​

The Apps drawer shows the extension name, while the App Directory shows the app name. Renaming the app does not rename the extension. Set the extension name when you create the extension. The Embedded settings screen does not include that field.


OAuth and authorization​

Clicking Connect returns to the Connect screen without an error​

The consent flow failed. Hootsuite sends authorizationError with a generic message and then isAuthorizing: false. It does not pass on the provider's own error. The template stores the message in appError, but its Authorize page does not display it. Common causes:

  • Popup blocked or closed. The browser blocked the consent popup, or the user closed it before finishing. Call requestAuthorization() directly from the click handler of your button, not after an await or a timer, and check the browser's popup settings.
  • Missing scope. Many providers reject a request without a scope. Enter the scopes your app needs in the Scope field of the OAuth 2.0 section, even though it is marked as optional.
  • Redirect URL not registered. Copy the redirect URL from the OAuth 2.0 section of your app and add it to your provider's OAuth app.
  • Wrong endpoints. Check the authorization URL and token URL against your provider's OAuth documentation.
  • Wrong scope mechanism. Some providers have other kinds of permission settings (for example, scopes for their own UI extensions). The Hootsuite flow uses only the scopes sent in the OAuth authorization request, which come from the Scope field in the Developer Portal.

Show appError from useHootsuite() in your Connect screen so users see a message when the host reports an error.

Do users need to reconnect after I switch between the development URL and the bundle?​

No. The authorization belongs to the app, not to the URL it loads from.

What happens when the provider token expires or the user revokes access?​

Hootsuite renews expired provider tokens for you, using the refresh token it stored when the user connected. It does this when the app starts and whenever the app asks the host for the token. If the user opens your app after the token expired, the app receives a renewed token and the user does not see Connect.

If the token expires while the app is open, the provider rejects it and your backend returns 401. The template's useBackend() then asks the host for a renewed token with requestAccessToken() and repeats the request once. The user does not see anything.

The user has to reconnect only when renewal is not possible: the refresh token expired, the user revoked access in the provider's settings, or the provider did not issue a refresh token.

  • When the app opens, the host sends no token, and the user sees Connect.
  • While the app is open, the host answers requestAccessToken() with accessTokenError, or returns the same token the provider just rejected. useBackend() sets needsReconnect, and the user sees Reconnect. The consent popup opens only when the user clicks that button.

Make sure your backend passes the provider's 401 through unchanged. See Token renewal.

My app takes a few seconds to show Reconnect​

requestAccessToken() waits up to 8 seconds for the host's answer before it gives up. The host normally answers right away, with a token or an error. If you see this delay, check the browser console for errors and check that HOOTSUITE_DASHBOARD_URL matches the dashboard's origin.

Can my app call Hootsuite APIs?​

No. The iframe runs on its own origin without a Hootsuite session. Use the surface context that the host sends, and your own backend for everything else.


Backend​

Requests to my backend fail with a CORS error​

  • Check that the backend allows the origin https://<HOOTSUITE_APP_ID>.hootsuite-apps.com, with the same app ID as your bundle.
  • For the development URL, the origin is https://localhost:<FRONTEND_PORT>. The example backend allows it by default only when NODE_ENV is not production. If your FRONTEND_PORT is not 8080, the allowed origin must use that port.
  • If you set ALLOWED_ORIGINS, it replaces the defaults exactly, so it must include https://<HOOTSUITE_APP_ID>.hootsuite-apps.com (and https://localhost:<FRONTEND_PORT> for development). Each entry must be an http or https origin. A trailing slash or a path is accepted but ignored: https://example.com/some/path is read as https://example.com. Check the Allowed origins: ... line to see the result.
  • After you change .env, stop npm start and run it again: the backend reads .env only once.
  • Read the Allowed origins: ... line the backend prints at startup: it shows the list the backend is actually using, and any entry it ignored.
  • See Call your own backend, Step 3.
  • Allow the Authorization and Content-Type headers and answer OPTIONS preflight requests.

Requests to my backend are blocked as mixed content​

A hosted bundle is served over HTTPS, so BACKEND_HOST must be an HTTPS URL. Deploy the backend on HTTPS, or use an HTTPS tunnel for testing, then rebuild and upload.

The hosted app stopped working after my backend URL changed​

BACKEND_HOST is written into app.js at build time. Update .env, run npm run build, upload the bundle, and save. Temporary tunnel URLs change often; use a stable domain for anything long-lived.

Should my backend validate the token?​

The example requireBearer middleware checks only that a Bearer token is present. Provider tokens are usually opaque, so the provider's API is what accepts or rejects them. Pass the provider's 401 back to the iframe.

Can my backend store the token to use later?​

No. Use the token sent with each request, and never store or log it. See Token handling rules.


Build and upload​

The build warns that app.js is too large​

Webpack's size warnings suggest code splitting, which Embedded apps do not support: Hootsuite requires a single app.js. You can ignore the warning.

Icons render as text, or components are unstyled, in the hosted app​

Call loadMaterialSymbols() and loadTheme('light') from your code. The dev server's public/index.html is not uploaded with the bundle, so <link> tags you add there do not apply to the hosted app.


Perch​

Perch closes my app when the user changes the week​

Interacting with the Perch calendar currently closes the apps drawer. When the user reopens your app, it receives the new week in its context. Read the context when the app loads.

Perch does not let users pick a single day​

Perch navigates by week or by month. selectedDate is an anchor date inside the visible period, so derive the range from it and from viewType. See Surface context reference.