kentcdodds / match-sorter

Simple, expected, and deterministic best-match sorting of an array in JavaScript
https://npm.im/match-sorter
MIT License
3.73k stars 129 forks source link

Unable to import match sorter from versions 5.0.0+ #119

Closed battlejj closed 3 years ago

battlejj commented 3 years ago

Relevant code or config

import matchSorter from 'match-sorter';

What you did: Tried to import match-sorter and use it.

What happened: When trying to use match-sorter I get the TypeScript error:

node_modules/match-sorter/dist/index")' has no call signatures.ts(2349)

Reproduction repository:

Going to https://github.com/kentcdodds/match-sorter/blob/master/other/EXAMPLES.md and clicking on the "Basic Example" and then changing the library version to 5.0.0+ will show the broken imports. 4.2.1 seems to be the last one that built correctly.

https://codesandbox.io/s/xenodochial-water-ffdow

Problem description:

No index.js appears to be created in the build.

Suggested solution:

Make the build work again.

battlejj commented 3 years ago

Closing because I copied an old example I guess and it should be:

import {matchSorter} from 'match-sorter';

whoops!