webview / webview_deno

🌐 Deno bindings for webview, a tiny library for creating web-based desktop GUIs
https://deno.land/x/webview
MIT License
1.44k stars 75 forks source link

Readme example "Uncaught NotFound" #147

Open LauraWebdev opened 1 year ago

LauraWebdev commented 1 year ago

Hey there, I'm having somewhat of a hard time playing around with this. I've managed to get a codebase working with the examples provided in this repo and wanted to create a clean project with the example provided in the Readme.

import { Webview } from "https://deno.land/x/webview/mod.ts";

const html = `
  <html>
  <body>
    <h1>Hello from deno v${Deno.version.deno}</h1>
  </body>
  </html>
`;

const webview = new Webview();

webview.navigate(`data:text/html,${encodeURIComponent(html)}`);
webview.run();

Running this via deno run -Ar --unstable .\src\app.ts results in the WebView2Loader.dll being created in the src folder and the following console error:

error: Uncaught (in promise) NotFound (os error 2)
  const metadata = await Deno.readTextFile(metapath(url, ns));
                   ^
    at async Object.readTextFile (deno:runtime/js/40_read_file.js:56:20)
    at async metaread (https://deno.land/x/cache@0.2.13/file.ts:138:20)
    at async FileWrapper.read (https://deno.land/x/cache@0.2.13/file.ts:85:18)
    at async FileWrapper.get (https://deno.land/x/cache@0.2.13/file.ts:108:20)
    at async cache (https://deno.land/x/cache@0.2.13/cache.ts:67:10)
    at async Wrapper.cache (https://deno.land/x/cache@0.2.13/cache.ts:21:12)
    at async download (https://deno.land/x/plug@0.5.2/plug.ts:107:16)
    at async prepare (https://deno.land/x/plug@0.5.2/plug.ts:116:16)
    at async https://deno.land/x/webview@0.7.5/src/ffi.ts:102:20

I am running deno 1.28.1 and the examples within the examples folder of this repo (which import webview_deno locally) work flawlessly.