Uncaught TypeError: instantsearch.widgets.dynamicWidgets is not a function

I am trying to add the DynamicWidget to an existing instant search project, that is largely an extension of the example provided by Algolia. I can’t get the Dynamic Widget to load (dynamics widget is not a function). What am I doing wrong?

So I’ll answer my own question here. It looks like Dynamic Widgets is a relatively new feature, which is not available from the CDN link shown in Algolia’s Getting Started section:

That links to InstantSearch version 4.8.3… instantsearch.js@4.8.3

However, we are currently at version 4.40.2 according to Github: Releases · algolia/instantsearch.js · GitHub

So I guess we’re only 32 versions behind in the Getting Started docs. So that’s why DynamicWidgets doesn’t work…because it isn’t supported in the version being recommended by the Getting Started page.

Thanks for the heads up, Jonathan. Did it work after updating to a more recent version? Looks like we need to update this example.

Yes, it works after updating to the latest version of instantsearch. You may also want to call this out in the documentation as well (this feature is only available as of instantsearch x.xx). Then it will be a lot easier to debug when it says that DynamicWidgets is not a function.

1 Like

Thanks for the feedback. We’ve cut internal tickets to update the docs to dynamically pull latest version for code snippets that load libraries from the CDN. In the meantime we’ll get this updated manually.

I also like the idea of tagging features with minimum version info. I’m going to do some research on if have this info available to surface in the docs.