melkam
melkam
DDeno
Created by melkam on 12/18/2024 in #help
Unable to target browser and deno with unstable features in typescript `compilerOptions.lib`
Hi. I followed the guide from docs to include libs for dom api and deno unstable features in the same environment. But it doesn't work for me. I added this to deno.json:
{
"unstable": ["webgpu"],
"compilerOptions": {
"lib": [
"dom",
"dom.iterable",
"dom.asynciterable",
"deno.ns",
"deno.unstable"
],
},
}
{
"unstable": ["webgpu"],
"compilerOptions": {
"lib": [
"dom",
"dom.iterable",
"dom.asynciterable",
"deno.ns",
"deno.unstable"
],
},
}
In my case I wanted to use webgpu api and render it on dom canvas
const canvas = document.createElement("canvas");
document.body.appendChild(canvas);
// no errors for dom api

const adapter = await navigator.gpu.requestAdapter();
^^^
Property 'gpu' does not exist on type 'Navigator'.
const canvas = document.createElement("canvas");
document.body.appendChild(canvas);
// no errors for dom api

const adapter = await navigator.gpu.requestAdapter();
^^^
Property 'gpu' does not exist on type 'Navigator'.
If I don't specify lib property in compilerOptions, I can access the navigator.gpu, but then I can't use dom api. Based on the docs the configuration above should allow for both api, but it doesn't work for me.
15 replies
DDeno
Created by melkam on 12/18/2024 in #help
Unable to request adapter for webgpu on WSL2
Hi. I would like to experiment with webgpu on wsl, but when I tried running my code with deno, I couldn't request adapter.
console.log(await navigator.gpu.requestAdapter()) // returns null on WSL2
console.log(await navigator.gpu.requestAdapter()) // returns null on WSL2
6 replies
DDeno
Created by melkam on 1/13/2024 in #help
Typescript intelisense between jupyter notebooks
No description
6 replies