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

PNG endpoint initWasm Bug #214

Closed
kamilsk opened this issue Aug 11, 2023 · 6 comments · Fixed by #230 or #256
Closed

PNG endpoint initWasm Bug #214

kamilsk opened this issue Aug 11, 2023 · 6 comments · Fixed by #230 or #256
Assignees
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@kamilsk
Copy link

kamilsk commented Aug 11, 2023

Downloaded url: https://socialify.git.ci/octomation/stub/png?description=1&font=Raleway&language=1&name=1&owner=1&pattern=Circuit%20Board&theme=Light

The error message

{
   "error":"Already initialized. The `initWasm()` function can be used only once.",
   "stack":"Error: Already initialized. The `initWasm()` function can be used only once.\n    at (vc/edge/function:74:6621)\n    at (vc/edge/function:74:6961)\n    at (vc/edge/function:74:7144)\n    at (vc/edge/function:81:14470)\n    at (vc/edge/function:14:16047)"
}
@kamilsk
Copy link
Author

kamilsk commented Aug 11, 2023

Also, I found that the emoji 🫥 isn't supported.

Expected

image

Obtained

image

(downloaded version is different from the version on the web page)

@kamilsk
Copy link
Author

kamilsk commented Nov 2, 2023

@wei, hi! Now I see

{"error":"unreachable","stack":"RuntimeError: unreachable\n    at (wasm://wasm/004f7a76:1:1194938)\n    at (wasm://wasm/004f7a76:1:1198329)\n    at (wasm://wasm/004f7a76:1:1198031)\n    at (wasm://wasm/004f7a76:1:1186270)\n    at (wasm://wasm/004f7a76:1:177689)\n    at (wasm://wasm/004f7a76:1:43502)\n    at (wasm://wasm/004f7a76:1:808077)\n    at (wasm://wasm/004f7a76:1:42895)\n    at (wasm://wasm/004f7a76:1:808077)\n    at (wasm://wasm/004f7a76:1:42895)"}

by following the link https://socialify.git.ci/octomation/stub/png?description=1&font=Raleway&language=1&name=1&owner=1&pattern=Circuit%20Board&theme=Light.

@wei wei reopened this Nov 3, 2023
@wei
Copy link
Owner

wei commented Nov 3, 2023

Ahh I can reproduce. Need to find another way to initialize wasm. My previous fix https://github.com/wei/socialify/pull/230/files did not work. The error changed from "Already initialized. The ``initWasm()`` function can be used only once." to "RuntimeError: unreachable".

Suggestions/PR welcome!

Currently it's imported on the API route

import renderCardPNG from '../../common/renderPNG'

Which imports renderPNG which initializes the wasm at

import resvgWasm from '../public/resvg_bg.wasm?module'

@wei wei added bug Something isn't working help wanted Extra attention is needed labels Apr 11, 2024
@wei wei mentioned this issue Apr 11, 2024
@wei wei changed the title a bug occurred when png tried to be downloaded PNG endpoint initWasm Bug Apr 11, 2024
@wei
Copy link
Owner

wei commented Apr 11, 2024

Looks like the error only occurs when there are emojis in the description. Let's investigate further in #255 perhaps that will fix the issue here too.

e.g. working without description:
https://socialify.git.ci/octomation/stub/png?description=1&descriptionEditable=Stub+domains+for+redirects.&font=Raleway&language=1&name=1&owner=1&pattern=Circuit%20Board&theme=Light

broken with description that contain emoji:
https://socialify.git.ci/octomation/stub/png?description=1&font=Raleway&language=1&name=1&owner=1&pattern=Circuit%20Board&theme=Light

@wei wei mentioned this issue Apr 11, 2024
@wei
Copy link
Owner

wei commented Apr 11, 2024

Fixed in #256 . Will deploy to prod once approved.

Try at https://socialify-git-fix-emojis-github-socialify.vercel.app/octomation/stub/png?description=1&font=Raleway&language=1&name=1&owner=1&pattern=Circuit%20Board&theme=Light

@wei wei closed this as completed in #256 Apr 11, 2024
@kamilsk
Copy link
Author

kamilsk commented Apr 13, 2024

thanks, @wei!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants