instantsearch.js 4.56.9 → 4.56.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/es/lib/server.js CHANGED
@@ -42,12 +42,17 @@ export function getInitialResults(rootIndex) {
42
42
  var initialResults = {};
43
43
  walkIndex(rootIndex, function (widget) {
44
44
  var searchResults = widget.getResults();
45
- initialResults[widget.getIndexId()] = {
46
- // We convert the Helper state to a plain object to pass parsable data
47
- // structures from server to client.
48
- state: _objectSpread({}, searchResults._state),
49
- results: searchResults._rawResults
50
- };
45
+ if (searchResults) {
46
+ initialResults[widget.getIndexId()] = {
47
+ // We convert the Helper state to a plain object to pass parsable data
48
+ // structures from server to client.
49
+ state: _objectSpread({}, searchResults._state),
50
+ results: searchResults._rawResults
51
+ };
52
+ }
51
53
  });
54
+ if (Object.keys(initialResults).length === 0) {
55
+ throw new Error('The root index does not have any results. Make sure you have at least one widget that provides results.');
56
+ }
52
57
  return initialResults;
53
58
  }
@@ -1,2 +1,2 @@
1
- declare const _default: "4.56.9";
1
+ declare const _default: "4.56.10";
2
2
  export default _default;
package/es/lib/version.js CHANGED
@@ -1 +1 @@
1
- export default '4.56.9';
1
+ export default '4.56.10';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "instantsearch.js",
3
- "version": "4.56.9",
3
+ "version": "4.56.10",
4
4
  "description": "InstantSearch.js is a JavaScript library for building performant and instant search experiences with Algolia.",
5
5
  "homepage": "https://www.algolia.com/doc/guides/building-search-ui/what-is-instantsearch/js/",
6
6
  "types": "es/index.d.ts",
@@ -55,9 +55,9 @@
55
55
  "version": "./scripts/version/update-version.js"
56
56
  },
57
57
  "devDependencies": {
58
- "@instantsearch/mocks": "1.23.0",
59
- "@instantsearch/tests": "1.23.0",
60
- "@instantsearch/testutils": "1.12.0",
58
+ "@instantsearch/mocks": "1.24.0",
59
+ "@instantsearch/tests": "1.24.0",
60
+ "@instantsearch/testutils": "1.13.0",
61
61
  "@storybook/html": "5.3.9",
62
62
  "@types/scriptjs": "0.0.2",
63
63
  "algoliasearch": "4.14.3",
@@ -65,5 +65,5 @@
65
65
  "scriptjs": "2.5.9",
66
66
  "webpack": "4.41.5"
67
67
  },
68
- "gitHead": "94deb1ad0715410c61f4aa285a78a36ccf367fd7"
68
+ "gitHead": "90a5e43746613d2f9eb3dc49fa15b1895d45c7bd"
69
69
  }