Coveo Object Unavailable in Lightning Component

Symptoms

When creating a Lightning component that bundles the Coveo components (see Integrating the Coveo Components in a Custom Lightning Component) and trying to reference the Coveo object, you get an error message that looks like one of the following messages:

Uncaught Action failed: c:communityCoveo$controller$onInterfaceContentLoaded [$ is not a function]

or

Cannot read property $ of undefined

Cause

Your custom component likely uses API version 40, which means that Lightning Locker is automatically enabled. When Lightning Locker is enabled, the window object is not shared with other components.

Resolution

Your custom component needs to use an API version prior to 40.0.

  1. In Salesforce, open the Developer Console (see Open the Developer Console).
  2. Open your custom component.
  3. In the right sidebar, select Bundle Version Settings.

  4. In the Bundle Version Settings window, next to API Version, select an API version prior to 40.0.
  5. Select Save.