-
-
Notifications
You must be signed in to change notification settings - Fork 53
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
Support WebAssambly #1377
Comments
I investigated the issue and found that the problem is not related to WebAssembly support. Your example:
To investigate the problem, I used
I found that the WASM file "./pkg/hello_world_bg.wasm" is failed to load because the relative URL is wrongly resolved against the location of Vivliostyle Viewer which the This can be fixed by using absolute URL, e.g. Try the following fixed code: index.html: <!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>Hello World</title>
<script type="module" src="./index.js"></script>
</head>
<body>
<div id="result"></div>
</body>
</html> index.js: import wasmInit from "./pkg/hello_world.js";
const runWasm = async () => {
const helloWorld = await wasmInit(new URL("./pkg/hello_world_bg.wasm", import.meta.url));
const addResult = helloWorld.add(24, 24);
document.getElementById('result').textContent = `Hello World! addResult: ${addResult}`;
};
runWasm(); Note that the |
Is your feature request related to a problem? Please describe.
Some tools that I have are created in rust compiled to wasm.
This are front-end tools that are used to render content, that are relevant for PDF generation.
Describe the solution you'd like
Please support WebAssambly.
This should not result in an empty PDF:
Describe alternatives you've considered
The alternative is to completely avoid wasm and everything that compiles to it.
I must admit, that this is not very high priority to me. It would be nice to have though.
The text was updated successfully, but these errors were encountered: