Code breaks after upgrading from v3.4.6 to v6.0.0
See original GitHub issuewhen upgrading from v3.4.6 to v6.0.0, my javascript code breaks
TypeError: Cannot read property ‘map’ of undefined
I’ve tracked down that the fuse.search() is returning undefined after upgrading, when before the upgrade.
import Fuse from 'fuse.js'
export default function filterRecipeList(searchValue, recipesToSearch) {
var options = {
shouldSort: true,
tokenize: true,
threshold: 0.3,
location: 0,
distance: 100,
maxPatternLength: 32,
minMatchCharLength: 1,
keys: ['id', 'name', 'ingredients.name']
}
console.log(recipesToSearch)
console.log('handleRecipeSearch options: ' + options)
var fuse = new Fuse(recipesToSearch, options) // "list" is the item array
console.log('handleRecipeSearch searchValue: ' + searchValue)
var result = fuse.search(searchValue)
console.log('handleRecipeSearch result: ' + result)
return result
}
Any Ideas? Does it have anything to do with my node.js version?
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:8 (2 by maintainers)
Top Results From Across the Web
Upgrade Windows Forms apps to .NET 6 - Microsoft Learn
In this article. Demo app; Analyze your app; Run upgrade-assistant; Visual Basic projects; After upgrading; Troubleshooting tips; See also.
Read more >Upgrading from ADF v5.0 to v6.0 - Alfresco Builder Network
The ADF project follows the semver conventions and so we only make breaking changes (ie, not backward-compatible) in major versions. ADF 6.0 is...
Read more >Releases - styled-components
Updating styled components is usually as simple as npm install . Only major versions have the potential to introduce breaking changes (noted in...
Read more >FortiOS Release Notes | FortiGate / FortiOS 6.4.9
DNS filter forwards the DNS status code 1 FormErr as status code 2 ServFail in ... proxy and SSL deep inspection stops working...
Read more >MUI Versions
These releases include breaking changes. When updating to a new major release, you may need to run update scripts, refactor code, run additional...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Okay, I figured it out. The search results are now wrapping each item in an object under key
item
. So to get it to work as before you need to do something like `results = results.map(i => i.item);This is actually mentioned in the changelog, without saying what was actually changed about the search results. The trick here is apparently this library doesn’t show breaking changes in major version updates, but in each of the beta updates, so you need to read through all of the many beta updates to pick up on breaking changes.
Yes. This is my bad. I failed to update the changelog. Will be more disciplined moving forward.