You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Multiplatform project uses ktor-client-core in its common sourceset and ktor-client-js in its javascript sourceset.
Kotlin react app depends on its multiplatform artifact
Backend JVM Ktor app depends on its multiplatform artifact a well
JVM Version, Operating System and Relevant Context
Running on Mac OS X Mojave
Feedback
I am trying to upload files from the kotlin react app to the backend. It works fine for little sized files but as soon as I try to upload a file bigger than ~1MB I get the following error:
IllegalArgumentException: should should be greater than write space + end gap (size = 9, writeRemaining = 0, endGap = 8, rem+gap = 8
at IllegalArgumentException_init_0 (http://localhost:9000/bundle.js:162304:32)
at require$ObjectLiteral_1.doFail (http://localhost:9000/bundle.js:34344:9)
at IoBuffer.writeBufferAppend_ehtrw3$ (http://localhost:9000/bundle.js:35661:7)
at ByteReadPacket_0.ByteReadPacketBase.prepareRead_87ik6q$ (http://localhost:9000/bundle.js:31628:10)
at ByteReadPacket_0.ByteReadPacketBase.readAsMuchAsPossible_v6e8td$_0 (http://localhost:9000/bundle.js:31444:15)
at ByteReadPacket_0.ByteReadPacketBase.readAsMuchAsPossible_v6e8td$_0 (http://localhost:9000/bundle.js:31455:19)
at ByteReadPacket_0.ByteReadPacketBase.readAsMuchAsPossible_v6e8td$_0 (http://localhost:9000/bundle.js:31455:19)
at ByteReadPacket_0.ByteReadPacketBase.readAsMuchAsPossible_v6e8td$_0 (http://localhost:9000/bundle.js:31455:19)
at ByteReadPacket_0.ByteReadPacketBase.readAsMuchAsPossible_v6e8td$_0 (http://localhost:9000/bundle.js:31455:19)
at ByteReadPacket_0.ByteReadPacketBase.readAsMuchAsPossible_v6e8td$_0 (http://localhost:9000/bundle.js:31455:19)"
The network request functions are written in the multiplatform commainMain sourceset so that they can be shared with Android and iOS in the future. I tried using .post, .submitForm and .submitFormWithBinaryData without seeing any success.
Ktor Version
1.1.2
Ktor Engine Used(client or server and name)
JVM Version, Operating System and Relevant Context
Running on Mac OS X Mojave
Feedback
I am trying to upload files from the kotlin react app to the backend. It works fine for little sized files but as soon as I try to upload a file bigger than ~1MB I get the following error:
The network request functions are written in the multiplatform commainMain sourceset so that they can be shared with Android and iOS in the future. I tried using
.post
,.submitForm
and.submitFormWithBinaryData
without seeing any success.Here's a repo with the 3 projects side by side for you to reproduce the issue: https://github.com/galex/reproducer-bug-ktor
Thank you,
Alex
The text was updated successfully, but these errors were encountered: