-
Notifications
You must be signed in to change notification settings - Fork 9
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
using MiniSearch.wildcard
throws an error
#42
Comments
Hi @roaminro , To be fair, I am not sure what is causing your issue. You might be right about the different imports, but I somehow cannot reproduce it. I added one test for wildcard search, which seems to pass though. The test basically performs a wildcard search by simulating a click on this button, and seems to work fine. Are you doing anything different? If you have time to share a small reproduction example, that would help me in figuring this out. For now, thanks for reporting this! |
Thanks for looking into this @lucaong ! I tried to create a minimal reproduction example and you're right, it works fine (https://stackblitz.com/edit/react-starter-typescript-ifvmgd?file=App.tsx) My setup involves Rollup, so I'm now wondering if something is happening during the bundling step which may cause that Symbol issue. It's going to be difficult to setup a minial example though, so I'm going to investigate a little more. I'm going to close this issue for now, and will reopen it if I find what's the root cause ;) |
Thanks a lot @roaminro ! |
This is basically the same as #28 |
In reality the underlying problem here is that this package only delivers a UMD version. That seems like it should work fine, it's universal after all. But as far as bundlers are concerned, the UMD file is just a cjs module. And because of this, and because it uses The most correct thing would be to do the thing that is fairly standard nowadays by delivering ECMAScript module and cjs versions (at least) and configuring the |
Thanks for the investigation @lyleunderwood . I will work to release the ES module alongside the cjs package, instead of UMD, if that helps solving this issue. |
This should better serve different needs, and also solve #42
Relevant PR: #47 |
This should better serve different needs, and also solve #42
Version |
Hey @lucaong thanks for the fast turnaround! I can confirm that this resolves the issue for me, only the But I also have a regression!
I'm using https://arethetypeswrong.github.io/?p=react-minisearch%407.1.1 |
@lyleunderwood thanks for reporting this issue with type declarations. I just released |
Confirmed, types are now working in my environment, and I'm only loading Thanks @lucaong ! |
Awesome, thank you @lyleunderwood ! |
Hi, @lucaong ! First, thanks for this amazing project, it's been a real pleasure working with this library!!!
I'm trying to use
search(MiniSearch.wildcard)
but for some reason doing so throws an error in the MiniSeach package. It looks like this check isn't workinghttps://github.com/lucaong/minisearch/blob/4fc49a43400b3dbce9f029f4c4a836ae56311928/src/MiniSearch.ts#L1489
And, so the next check is actually being triggered
https://github.com/lucaong/minisearch/blob/4fc49a43400b3dbce9f029f4c4a836ae56311928/src/MiniSearch.ts#L1493C27-L1493C27
and fails when trying to
map
the queries which don't exist on the wildcard Symbolhttps://github.com/lucaong/minisearch/blob/4fc49a43400b3dbce9f029f4c4a836ae56311928/src/MiniSearch.ts#L1495
I wonder if the
widlcard
symbol isn't recognized because it's coming from another "import" of the MiniSearch package?The text was updated successfully, but these errors were encountered: