webview / webview_deno

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

two examples on the main page might need to be updated #167

Open ds604 opened 5 months ago

ds604 commented 5 months ago

If I try to run this example from the main page

deno run -Ar --unstable https://deno.land/x/webview/examples/local.ts

I get the following error:

Warning Implicitly using latest version (0.8.0) for https://deno.land/x/webview/examples/local.ts
error: Relative import path "@denosaurs/plug" not prefixed with / or ./ or ../
    at https://deno.land/x/webview@0.8.0/src/ffi.ts:3:34

The example above this one gives the same error. Adding the jsr prefix lets it run correctly:

deno run -Ar --unstable - <<-"EOF"
import { Webview } from "jsr:@webview/webview";

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();
EOF
kuchta commented 5 months ago

I had the same problem. Also worth mentioning is:

⚠️  The `--unstable` flag is deprecated and will be removed in Deno 2.0. Use granular `--unstable-*` flags instead.
Learn more at: https://docs.deno.com/runtime/manual/tools/unstable_flags
⚠️  The `Deno.dlopen` API was used with `--unstable` flag. The `--unstable` flag is deprecated and will be removed in Deno 2.0. Use granular `--unstable-ffi` instead.