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

Unable to create wasm component #242

Open
sriramgarimella opened this issue May 30, 2024 · 1 comment
Open

Unable to create wasm component #242

sriramgarimella opened this issue May 30, 2024 · 1 comment

Comments

@sriramgarimella
Copy link

Hi team

I was trying spin-js plugin,by extending it to a existing react application built using vite framework. I had the below command to build the project

"Vite build && npx mkdirp Target && spin js2wasm -o target/xxx.wasm dist/assets/index-xxx.js"

During spin I am getting below error
Uncaught reference error: document is not defined inside crates\spin-js-engine.

Can we use the spin-js framework for a application built with framework like vite ? Can you help me with an example code with the integration please

@bacongobbler
Copy link
Member

bacongobbler commented May 30, 2024

Hey @sriramgarimella, thanks for reaching out!

I suppose the first question I'm curious to know is where do you intend to use this webassembly module. Are you trying to compile it as part of your Spin application, or somewhere else? For example, are you trying to compile your application to WebAssembly so you can run it in the browser?

Once we know the answer to that question, we might be able to point you in the right direction.

If your project is open source, a link to your project would be highly appreciated.

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

2 participants