-
-
Notifications
You must be signed in to change notification settings - Fork 32
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
Consider releasing a version that does not require a bundler to the npm registry #6
Comments
Hey @GarciaLnk, thanks for your suggestion! I'll explore the options. At the meantime, you can directly import the // cjs
const voy = require("voy-search/voy_search_bg.wasm");
// or esm
const voy = await import("voy-search/voy_search_bg.wasm"); |
AFAIK to import a WASM module as a native ES module you need a bundler that has proper support for it, which is the root of the issue (see: https://rustwasm.github.io/docs/wasm-bindgen/reference/deployment.html#bundlers). |
Wanted to test it quickly by loading from CDN trough unpkg So I could add script tag to a html page like this: That results in an error: As far as I understand direct importing of wasm modules is not supported yet I did manage to make it work with this code
|
@wonderwhy-er thanks so much for reporting. Could you attach your embeddings or show me how did you generate them so I can reproduce the error? Thanks! |
Ouh its my bad, it seems to work. And for whatever reasons in some cases it returns [number[]] instead of number[] for encoding |
Amazing! Have fun:) |
Hey @wonderwhy-er I'm also looking to get voy work in the browser, potentially with up to 1GB or records. Would you be able to share your wasm solution? |
@MentalGear sorry missed your question, I since then switched to using other things |
Right now, it's impossible to use the library directly from npm without using a bundler like Webpack, consider releasing a build using the
--target web
flag to allow using it without a bundler, or with bundlers that don't properly support WASM yet (like Parcel v2).The text was updated successfully, but these errors were encountered: