travis-r6s / gridsome-plugin-flexsearch

Add lightning fast search to Gridsome with FlexSearch
24 stars 7 forks source link

v2 Causes undefined Error #71

Closed RehanSaeed closed 3 years ago

RehanSaeed commented 3 years ago

I'm trying to upgrade to v2 and am getting the following error upon building:

image

travis-r6s commented 3 years ago

Hey @RehanSaeed - Would you mind posting your gridsome.config.js please?

RehanSaeed commented 3 years ago

It's all on GitHub here: https://github.com/RehanSaeed/rehansaeed.github.io/blob/main/gridsome.config.js

travis-r6s commented 3 years ago

Sorry for the delay on this. Have just fixed the issue though, and released a patch version - 2.0.1. I've tested it out on your repo, and it seems to build okay now.

RehanSaeed commented 3 years ago

Gave 2.0.1 a try. It now compiles fine and I can search to get results back but the result.path or result.node.permalink values are undefined.

mschmidtkorth commented 3 years ago

I can confirm the same.

Thanks a lot by the way for introducing the GraphQL layer, @thetre97!

travis-r6s commented 3 years ago

Ah, that is actually one big change I have made - apologies, I should have put that into the release notes. The plugin doesn't automatically add the path field anymore, so you will have to add path or permalink to your collection fields, then you can access them from node.<field>.

RehanSaeed commented 3 years ago

That worked, thanks.