Search code examples
mongodbmeteormeteor-easy-search

why do I get "index is not defined" error using easy:search


I'm just trying to set up a basic search tool in Meteor to find articles in my MongoDB collection, but I'm struggling to get off the ground (if anyone has a good tutorial for an alternative search tool I'm open to suggestions).

I've settled on easy:search because it seemed like a simple search tool to get running, however one paragraph into their getting started instructions and I'm already getting an error:

ReferenceError: Index is not defined

although correct me if I'm wrong, but isn't that what the

import { Index, MinimongoEngine } from 'meteor/easy:search'

line is for?

EDIT: I have tried using the import line on both the client and the server side and I get the same error either way


Solution

  • this problem was fixed when I included the "import" line in the "lib" folder along with the other code (specified here) to be run on both server and client

    disclaimer: I uninstalled and reinstalled meteor and may have changed something else along the way which may have been the true solution, but this appears to be the triggering change