Skip to content

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

@Palid

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions