Hi All,
I noticed that pickFile method from context.device doesn't work in harness (or more specifically always returns undefined). Any estimates when it will be enabled to use in harness?
I have this code but doesn't work, you know what I'm wrong?
1. This is how I create the button and add the onclick event:
2. This is the openFilesBrowser func:
3. And this is the getConvertedFile:
And when I click the button it doesn't open the browser and send me this error:
Hi @v-siky-msft ,
Sure, I created a button and on button click, I trigger function that should obtain the file. Inside the function, I am just using context.device.pickFile and it always executes successfully and returns undefined as a result.
this._pickFileBtn = document.createElement('button');
this._pickFileBtn.innerText = "Select Audio";
this._pickFileBtn.onclick = () => this.getAudioFile();
private getAudioFile() {
this._context.device.pickFile().then(
(result) => this.setAudioFile(result),
(e) => console.error("Error occured:", e)
);
}
context.device.pickFile works fine when I use it in real environment.
I checked out how context.device.pickFile is executed in harness and can see that it return Promise with undefined value under the hood.
Hi @OOlashyn ,
Could you please share more about your scenario?
Some screenshots or code would be better to help you.
Best regards,
Sik
WarrenBelz
109
Most Valuable Professional
Michael E. Gernaey
82
Super User 2025 Season 1
MS.Ragavendar
72