Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Webview does not open when script is run via package.json #26

Open
dolsem opened this issue Dec 26, 2024 · 0 comments
Open

Webview does not open when script is run via package.json #26

dolsem opened this issue Dec 26, 2024 · 0 comments

Comments

@dolsem
Copy link

dolsem commented Dec 26, 2024

I have a minimal Bun script like this:

import { Webview } from 'webview-bun';
import htmlFile from './build/index.html' with { type: 'file' };

const html = await Bun.file(htmlFile).text();
const webview = new Webview();
webview.setHTML(html);
webview.run();

It works fine if I run it like bun run webview.ts (except I get a benign error when the script finishes running, [1225/224708.165:ERROR:window_impl.cc(121)] Failed to unregister class Chrome_WidgetWin_0. Error = 1411).

If instead I add a package.json script: "webview": "bun run webview.ts" and run bun webview, the script gets stuck when trying to spawn the webview, with no error message. If I Ctrl-C to stop it, I see the same benign error as before.

My OS is Windows 11.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant