usablica/intro.js · warning

introJs() is deprecated. Please use introJs.tour() or introJ

Error message

introJs() is deprecated. Please use introJs.tour() or introJs.hint() instead.

What it means

This is a deprecation warning (not an exception) emitted via console.warn when the legacy introJs() factory is called. The library split into introJs.tour() and introJs.hint(), and introJs() now returns a LegacyIntroJs instance kept only for backward compatibility. Code will still run but should migrate.

Source

Thrown at src/index.ts:41

    );
  }

  /**
   * @deprecated introJs().removeHints() is deprecated, please use introJs.hint.hideHints() instead
   * @param args
   */
  removeHints(..._: any[]) {
    console.error(
      "introJs().removeHints() is deprecated, please use introJs.hint.removeHints() instead."
    );
  }
}

/**
 * Intro.js module
 */
const introJs = (elementOrSelector?: string | HTMLElement) => {
  console.warn(
    "introJs() is deprecated. Please use introJs.tour() or introJs.hint() instead."
  );
  return new LegacyIntroJs(elementOrSelector);
};

/**
 * Create a new Intro.js Tour instance
 * @param elementOrSelector Optional target element to start the Tour on
 */
introJs.tour = (elementOrSelector?: string | HTMLElement) =>
  new Tour(elementOrSelector);

/**
 * Create a new Intro.js Hint instance
 * @param elementOrSelector Optional target element to start the Hint on
 */
introJs.hint = (elementOrSelector?: string | HTMLElement) =>
  new Hint(elementOrSelector);

View on GitHub (pinned to e5517e6a24)

Solutions

  1. Replace introJs(el) with introJs.tour(el) when starting a guided tour.
  2. Replace introJs(el) with introJs.hint(el) when adding hint bubbles.
  3. Audit wrappers/imports for the legacy call and update them; silence or fix warnings surfaced in CI logs.
  4. Consult the migration guide for renamed options between the legacy and new API.

Example fix

// before
const intro = introJs('#steps');
intro.start();
// after
const tour = introJs.tour('#steps');
tour.start();
Defensive patterns

Strategy: validation

Prevention

When it happens

Trigger: Any direct call: introJs(); introJs('#target'); introJs(document.body); including old initialization snippets or wrappers that still call the bare factory.

Common situations: Upgrading Intro.js across the major version that split the API; copy-pasted legacy integration code; third-party wrapper libraries or docs examples still using introJs(element).


AI-assisted analysis of usablica/intro.js@e5517e6a24 (2026-08-31). Data as JSON: /api/errors/4db5c52405f18160. Report an issue: GitHub.