Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Palid opened this issue Jul 24, 2023 · 0 comments
Open

Comments

@Palid
Copy link

Palid commented Jul 24, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant