Hi, I currently have the following code: ```import...
# javascript
c
Hi, I currently have the following code:
Copy code
import 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:
Copy code
ReferenceError: File is not defined
The generated JS code in
build/
looks like:
Copy code
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-.html
t
Looks like you need use
Blob
instead