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
import JavaScriptKit
import TokamakDOM
structTokamakApp:App{varbody:someScene{WindowGroup("Tokamak App"){ContentView()}}}structContentView:View{varbody:someView{VStack{HTML("input",["id":"file","type":"file"])Button("Convert"){letdocument=JSObject.global.document
letinput= document.getElementById("file")letfile= input.files.item(0).object!
letpromise= file.text.function!.callAsFunction().object!
JSPromise<JSValue,Error>(promise)!.then{ value inletconsole=JSObject.global.console.object!
letlog= console.log.function!
log(value)}}}}}
// @main attribute is not supported in SwiftPM apps.
// See https://bugs.swift.org/browse/SR-12683 for more details.
TokamakApp.main()
which is throwing this error:
Unhandled Promise Rejection: TypeError: Can only call Blob.text on instances of Blob
I know that this is more of a support issue than a bug report, but I really don't know what else to try, and didn't find another help channel.
Here is the entire script using Tokamak:
which is throwing this error:
Running
works though.