-
Notifications
You must be signed in to change notification settings - Fork 2
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
Every new release breaks deployed apps #82
Comments
@gyzerok Yes, we were aware of this point. That's why we introduce wasmUrl property #80. When using CDN, it'd be hard to ensure consistent loading time and reproducible builds as you mentioned. The |
@tinyjin yeah, thank you! I'll wait for the next version, check that everything works with and will close the issue if so. |
One thing though: it'd be nice if fallback would point to the concrete version from unpkg instead of always latest. Otherwise fallback will still break in production on releases. |
@gyzerok ThankPlz check this ;) Custom WASM URL has just shipped to Web Component<lottie-player
autoPlay
loop
src="https://lottie.host/6d7dd6e2-ab92-4e98-826a-2f8430768886/NGnHQ6brWA.json"
wasmUrl="/dist/thorvg-wasm.wasm"
style="width: 300px; height: 300px"
></lottie-player> JS-creationplayer = document.createElement('lottie-player');
player.autoPlay = true;
player.loop = true;
player.wasmUrl = '/thorvg-wasm.wasm'; // Set Custom WASM URL
player.renderConfig = { renderer }; React/NextJS |
Agree, will fix it soon. You can follow up this issue. |
@tinyjin when trying to import it with vite like so |
Seems like what you are missing is this in "exports": {
".": {
"import": "./dist/lottie-player.cjs.js",
"require": "./dist/lottie-player.esm.js"
},
"./dist/thorvg-wasm.wasm": {
"import": "./dist/thorvg-wasm.wasm",
"require": "./dist/thorvg-wasm.wasm"
}
}, |
@gyzerok import wasmUrl from "../node_modules/@thorvg/lottie-player/dist/thorvg-wasm.wasm" I think WASM binary file doesn't have to be handled by module bundler. Thus that is easy way to go. |
@tinyjin will try it out, but I think it does, because multiple deployments have to have different versions and vite adds content hash to the file during builds. This way there are no conflicts between versions of the |
@tinyjin I've tried it and getting the same error. I think without the |
@tinyjin sorry for the ping, but it seems like you've missed my last comment |
@gyzerok Sorry for being late. Thanks for letting us know! We'll review and support WASM entry export : ) |
Awesome, thank you! |
Hello there!
Every new release you are making is causing us breakage before we update to it. This is because you are pointing to the latest version in your code
thorvg.web/src/lottie-player.ts
Line 34 in e189798
The best solution would be of course to use local copy of the wasm file from
node_modules
, so projects do not depend on 3rd-party cdn and have reproducible builds. But even using appropriate version fromunpkg
would already go a long way.Thank you!
The text was updated successfully, but these errors were encountered: