From 09d8d3dffff035ef96f949dce98ed96445014a13 Mon Sep 17 00:00:00 2001 From: Raymond Rutjes Date: Tue, 15 Aug 2017 15:52:36 +0200 Subject: [PATCH] feat(highlight): throw error if missing config in Algolia Closes: #273 --- src/components/Highlight.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/components/Highlight.js b/src/components/Highlight.js index dc8db78a3..84df72b50 100644 --- a/src/components/Highlight.js +++ b/src/components/Highlight.js @@ -17,6 +17,11 @@ export default { let attributeValue = ''; if (result._highlightResult && result._highlightResult[attributeName]) { attributeValue = result._highlightResult[attributeName].value; + } else if (process.env.NODE_ENV !== 'production') { + throw new Error( + `The "${attributeName}" attribute is currently not configured to be highlighted in Algolia. + See https://www.algolia.com/doc/api-reference/api-parameters/attributesToHighlight/.` + ); } return h('span', {