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

Hash files on wasm snippet breaks wasm imports #376

Open
DennisJensen95 opened this issue Oct 16, 2024 · 0 comments
Open

Hash files on wasm snippet breaks wasm imports #376

DennisJensen95 opened this issue Oct 16, 2024 · 0 comments

Comments

@DennisJensen95
Copy link
Contributor

Inline{num}.js with hash breaks the imports in webassembly package in the frontend.

So the case is the following where i have my site directory:

tree site/pkg 
site/pkg
├── digitalt-haandvaerk.HuD81diBfNuG42TNaU25xQ.js
├── digitalt-haandvaerk.i9AokiMJC7DE9hQ8undZAA.css
├── digitalt-haandvaerk.vLtC8wK4np8rkwpuF5QdJA.wasm
└── snippets
    └── openlayer-rs-c384bd82f6cf7534
        └── inline0.g3NfIIkxtWHXCd96hHqZxg.js

So i am importing my own module like so

openlayer-rs = { path = "../../lib/openlayer-rs" }

Now it works just fine when i do not run my build with LEPTOS_HASH_FILES=true.

But when i do put on the hash my webassembly code is looking for the wrong inline0.js file. The error is the following:

localhost/:1 Uncaught (in promise) TypeError: WebAssembly.instantiate(): Import #44 "./snippets/openlayer-rs-c384bd82f6cf7534/inline0.js": module is not an object or function
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

1 participant