-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Closed
Labels
Description
Current behavior
when I do a search I have this error :
TypeError: Invalid attempt to spread non-iterable instance
at _nonIterableSpread (vsf-search-panel.5d5b39b5d74683045a5f.hot-update.js:20)
at _toConsumableArray (vsf-search-panel.5d5b39b5d74683045a5f.hot-update.js:18)
at SearchPanel.vue:122
at Array.forEach (<anonymous>)
at VueComponent.categories (SearchPanel.vue:116)
at Watcher.get (vue.runtime.esm.js:4473)
at Watcher.evaluate (vue.runtime.esm.js:4578)
at VueComponent.computedGetter [as categories] (vue.runtime.esm.js:4830)
at Object.get (vue.runtime.esm.js:2072)
at Proxy.render (SearchPanel.vue?d4a6:75)
the problem is that if a product is in any category this code is not working :
[...product.category].forEach(category => {
categoriesMap[category.category_id] = category
})it's normal because product.category is undefined.
we need to implement this verification I think :
if (product.category) {
[...product.category].forEach(category => {
categoriesMap[category.category_id] = category
})
}Thanks
Expected behavior
Steps to reproduce the issue
Repository
Can you handle fixing this bug by yourself?
- YES
- NO
Which Release Cycle state this refers to? Info for developer.
Pick one option.
- This is a bug report for test version on https://test.storefrontcloud.io - In this case Developer should create branch from
developbranch and create Pull Request2. Feature / Improvementback todevelop. - This is a bug report for current Release Candidate version on https://next.storefrontcloud.io - In this case Developer should create branch from
releasebranch and create Pull Request3. Stabilisation fixback torelease. - This is a bug report for current Stable version on https://demo.storefrontcloud.io and should be placed in next stable version hotfix - In this case Developer should create branch from
hotfixormasterbranch and create Pull Request4. Hotfixback tohotfix.
Environment details
- Browser: Chrome Version 72.0.3626.81 (Build officiel) (64 bits)
- OS: Debian GNU/Linux 9.9
- Node: v10.16.3
- Code Version: v1.10.4