-
Notifications
You must be signed in to change notification settings - Fork 1
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
Importing kzg-wasm into the vue project prompts that the module cannot be found #10
Comments
Hi there, the library is still in very active development and most recent releases were breaking. Which version are you using? |
Ok, so I plainly installed the latest library version and tested your test code in the console. So that works. Can you provide us either with a repository link or some script which causes the issue to occur? Otherwise we will likely not be able to reproduce your error. |
Hi! Ok I have something similar about the module "module" :
Looking at the doc referenced, it says that it tries to load a nodejs module. Indeed, in the kzg.js file, we can see a
Edit: I did not read it correctly lol. But I see a big if/else block to change behavior depending of whether we are in nodejs or browser, and Vite bundler is not catching that. So I guess it a matter of telling the bundler to ignore that... So probably not a bug for this project itself! |
Ok so it is dirty, but I used on vite.config.js export default defineConfig({
resolve: {
alias: {
module: "./index.js"
}
},
}) Aliasing If this project is strictly for browser, and not for nodejs, maybe removing the big if/else and the code related to nodejs? Thanks! |
This is a multi-platform library and we use it within a variety of nodejs contexts within our core libraries. Unfortunately, I'm limited by what the |
Thanks, no worries, this is a minor thing, your project is already very great! |
@nand2 Can you try updating your version of the |
Hi @acolytec3 ! |
Have just released v0.4.0 to NPM so you should be able to update your dependencies. Make sure you use tree shaking! The wasm + trusted setup in the module are hefty and duplicated across each build so it's not a small dep unfortunately. |
import {loadKZG} from 'kzg-wasm'; const kzg = await loadKZG(); console.log(kzg)
Nodejs: v18.15.0
Vue: 2.6.11
The text was updated successfully, but these errors were encountered: