webview_deno icon indicating copy to clipboard operation
webview_deno copied to clipboard

two examples on the main page might need to be updated

Open ds604 opened this issue 10 months ago • 1 comments

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/[email protected]/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

ds604 avatar Apr 03 '24 14:04 ds604

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.

kuchta avatar Apr 03 '24 15:04 kuchta