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

shiroa.js failed to load LinkError: import object field '__wbindgen_closure_wrapper1668' is not a Function #100

Open
kxxt opened this issue Jan 17, 2025 · 1 comment · May be fixed by #101

Comments

@kxxt
Copy link

kxxt commented Jan 17, 2025

Hi,

Thanks for creating such a nice project!

I encountered an error when opening the web page hosted by shiroa serve:

new svg util updated 37   124 svg_utils.js:3:5679
using deprecated parameters for the initialization function; pass a single object instead shiroa.js:4389:15
downloadable font: Glyph bbox was incorrect (glyph ids 33 55 62 81 82 83 84 87 88 89 90 112 119 120 123 139 159 162 164 166 178 184 185 217 218 272 273 274 275 279 281 284 290 291 292 309 310 319 321 323 326 329 330 331 332 333 334 339 341 347 349 351 352 353 354 357 358 361 366 367 370 371 414 431 436 444 445 458 460 464 465 483 505 508 511 514 516 517 518 520 521 538 539 546 568 574 579 580 585 586 594 596 599 602 603 616 618 622 627 629 630 633 634 638 643 645 651 654 665 675 685 686 688 691) (font-family: "FontAwesome" style:normal weight:400 stretch:100 src index:1) source: http://127.0.0.1:25520/theme/FontAwesome/fonts/fontawesome-webfont.woff2?v=4.7.0
GET
http://127.0.0.1:25520/favicon.ico
[HTTP/1.1 404 Not Found 0ms]

shiroa.js failed to load LinkError: import object field '__wbindgen_closure_wrapper1668' is not a Function 127.0.0.1:25520:82:21
    typstRenderModuleReady http://127.0.0.1:25520/:82
    (Async: promise callback)
    <anonymous> http://127.0.0.1:25520/:81
Uncaught (in promise) TypeError: plugin is undefined
    reloadArtifact http://127.0.0.1:25520/internal/shiroa.js:1792
    reloadArtifact http://127.0.0.1:25520/internal/shiroa.js:1791
    typstBookRenderPage http://127.0.0.1:25520/internal/shiroa.js:1824
    <anonymous> http://127.0.0.1:25520/:228
    promise callback* http://127.0.0.1:25520/:227
shiroa.js:1792:7

It seems that only my built from source shiroa has this bug. Binary downloaded from GitHub releases is not affected.

I tried to downgrade rust from 1.84 to 1.83 which appears to be what the release CI is using at the time of 0.2.0 release, but this bug still occurs.

kxxt added a commit to kxxt/shiroa that referenced this issue Jan 17, 2025
@kxxt kxxt linked a pull request Jan 17, 2025 that will close this issue
@kxxt
Copy link
Author

kxxt commented Jan 17, 2025

The frontend is built against the typst_ts_renderer_bg.wasm installed in node_modules. However, the cli ships a prebuilt typst_ts_renderer_bg.wasm from https://github.com/Myriad-Dreamin/typst/tree/assets-book-v0.2.0 . This mismatch can cause wasm load failures(#100).

I have opened #101 to fix it. PTAL

kxxt added a commit to kxxt/shiroa that referenced this issue Jan 19, 2025
Replace independent build script with build.rs
by building frontend in build.rs.

Disable build timestamp and git info emission
to avoid triggering build.rs too often.

Fix Myriad-Dreamin#100
kxxt added a commit to kxxt/shiroa that referenced this issue Jan 19, 2025
kxxt added a commit to kxxt/shiroa that referenced this issue Jan 19, 2025
Replace independent build script with build.rs
by building frontend in build.rs.

Disable build timestamp and git info emission in debug mode
to avoid triggering build.rs too often.

Fix Myriad-Dreamin#100
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

Successfully merging a pull request may close this issue.

1 participant