Barmaley
Barmaley

Reputation: 16363

okio: can't sync file with JS in kotlin multiplatform

I have following code in KMP:

   val fileSystem: FileSystem = NodeJsFileSystem
   val path = "photo".toPath()
   fileSystem.sink(path).close()

In browser I see in logs smth like:

Exception handled = IOException: openSync is not a function at toIOException (webpack-internal:///./kotlin/okio-parent-okio-nodefilesystem.js:279:122) at openFd (webpack-internal:///./kotlin/okio-parent-okio-nodefilesystem.js:272:15) at protoOf.sink_3ey1xj_k$ (webpack-internal:///./kotlin/okio-parent-okio-nodefilesystem.js:384:14) at protoOf.sink$default_shv2w8_k$ (webpack-internal:///./kotlin/okio-parent-okio.js:9802:35) at protoOf.createTempFile_oo2seq_k$ (webpack-internal:///./kotlin/ReverseAcquiring-shared.js:104302:85) at protoOf.toPhotoInfo_eusk8b_k$ (webpack-internal:///./kotlin/ReverseAcquiring-shared.js:29378:45) at eval (webpack-internal:///./kotlin/ReverseAcquiring-shared.js:35240:37) at protoOf.convert_n55856_k$ (webpack-internal:///./kotlin/ReverseAcquiring-shared.js:34406:31) at protoOf.doResume_5yljmg_k$ (webpack-internal:///./kotlin/ReverseAcquiring-shared.js:35904:29) at protoOf.resumeWith_b9cu3x_k$ (webpack-internal:///./kotlin/kotlin-kotlin-stdlib.js:8144:34)

Any ideas how to overcome situation?

Upvotes: 0

Views: 46

Answers (0)

Related Questions