JetBrains / compose-multiplatform

Compose Multiplatform, a modern UI framework for Kotlin that makes building performant and beautiful user interfaces easy and enjoyable.
https://jetbrains.com/lp/compose-multiplatform
Apache License 2.0
15.88k stars 1.15k forks source link

web ktor unable to make requests #3916

Closed ismai117 closed 10 months ago

ismai117 commented 10 months ago

api request works for android, iOS and desktop. Im able to receive a response but its not working for web and im receiving the error below

[Error] WebGL: INVALID_ENUM: getParameter: invalid parameter name, WEBGL_debug_renderer_info not enabled
    getParameter
    _glGetString (skiko.js:5776)
    wasm-stub
    <?>.wasm-function[14055]
    <?>.wasm-function[14514]
    <?>.wasm-function[14187]
    <?>.wasm-function[14221]
    <?>.wasm-function[11263]
    <?>.wasm-function[11264]
    <?>.wasm-function[1134]
    wasm-stub
    (anonymous function) (skiko.js:705)
    (anonymous function) (quranhouse-app.js:94238)
    CanvasRenderer (quranhouse-app.js:114250)
    SkiaLayer$attachTo$1 (quranhouse-app.js:114560)
    (anonymous function) (quranhouse-app.js:114750)
    (anonymous function) (quranhouse-app.js:114767)
    ComposeWindow (quranhouse-app.js:184901)
    CanvasBasedWindow$composable (quranhouse-app.js:184724)
    preComposeWindow$composable (quranhouse-app.js:249354)
    main$lambda (quranhouse-app.js:419678)

[Error] Failed to load resource: the server responded with a status of 404 (Not Found) (sql-wasm.wasm, line 0)
[Error] Failed to load resource: the server responded with a status of 404 (Not Found) (sql-wasm.wasm, line 0)
[Warning] wasm streaming compile failed: TypeError: Unexpected response MIME type. Expected 'application/wasm'
[Warning] falling back to ArrayBuffer instantiation
[Error] Failed to load resource: the server responded with a status of 404 (Not Found) (sql-wasm.wasm, line 0)
[Error] Failed to load resource: the server responded with a status of 404 (Not Found) (sql-wasm.wasm, line 0)
[Error] Failed to load resource: the server responded with a status of 404 (Not Found) (sql-wasm.wasm, line 0)
[Error] Failed to load resource: the server responded with a status of 404 (Not Found) (sql-wasm.wasm, line 0)
[Warning] failed to asynchronously prepare wasm: CompileError: WebAssembly.Module doesn't parse at byte 0: module doesn't start with '\0asm'
[Warning] Aborted(CompileError: WebAssembly.Module doesn't parse at byte 0: module doesn't start with '\0asm')
[Error] Unhandled Promise Rejection: RuntimeError: Aborted(CompileError: WebAssembly.Module doesn't parse at byte 0: module doesn't start with '\0asm'). Build with -sASSERTIONS for more info.
[Error] Unhandled Promise Rejection: DataCloneError: The object can not be cloned.
    postMessage
    onError
chrisjenx commented 10 months ago

As this is with the Ktor Client, I would raise this ticket with the Ktor Tracker. Sounds like the Ktor client wasm issue vs Compose Multiplatform (unless this issue goes away when just on a pure wasm project no compose)

igordmn commented 10 months ago

Please, create an issue in https://youtrack.jetbrains.com/newIssue?project=KTOR, with a reproducer code

okushnikov commented 2 weeks ago

Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.