CLOVIS
06/20/2020, 1:48 PMimport org.w3c.files.Blob
import org.w3c.files.File
val data: Blob = ...
File(
Array<Blob>(1) {data},
"image.png"
)
This is in jsTest of a Multiplatform project. The IDE doesn't have a problem with it, nor does Gradle. When I run it, I get:
ReferenceError: File is not defined
The generated JS code in build/
looks like:
new File(array, 'image.png')
where array
is generated with a normal for
loop. The IDE does link it with what appears to me as the correct definition, in a TypeScript file.
I'm running Chromium 83, and according to https://caniuse.com/#feat=fileapi it is supported.
Sorry if that's something dumb or obvious, I'm new to the JS world and I'm completely lost as to what could cause this, especially since the error message doesn't hint toward anything.
The File constructor is even defined in the Kotlin standard library for JS: https://kotlinlang.org/api/latest/jvm/stdlib/org.w3c.files/-file/-init-.htmlturansky
06/20/2020, 3:27 PMturansky
06/20/2020, 3:29 PMBlob
instead