Skip to content

Does not work properly with node.js (example of vercel edge hosting) #1

Description

@Palid

Node crashes when importing the fuzzyMatch like from the examples, e.g.
import createFuzzySearch from '@nozbe/microfuzz'

Seems that the issue is that it's being exported as a es6 module, while not properly being marked as such. Vite/Webpack can handle this no problem, but node gets confused.
See the following console log from server:

{
  __esModule: true,
  default: [Function: createFuzzySearch],
  fuzzyMatch: [Function: fuzzyMatch],
  normalizeText: [Function: normalizeText]
}

A simple solution would be to just not use default import/export, which should solve the issue by destructuring.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions