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

server example not working on Deno 2 and OS X #182

Open
nzoschke opened this issue Oct 24, 2024 · 7 comments
Open

server example not working on Deno 2 and OS X #182

nzoschke opened this issue Oct 24, 2024 · 7 comments
Labels
bug Something isn't working duplicate This issue or pull request already exists macos Related to macOS

Comments

@nzoschke
Copy link

It seems like the webview causes the program to hang and not serve any HTTP responses, nor show any output in the wevbiew.

Steps to reproduce:

$ deno -version
deno 2.0.2
$ uname -a
Darwin studio.local 23.5.0 Darwin Kernel Version 23.5.0: Wed May  1 20:12:58 PDT 2024; root:xnu-10063.121.3~5/RELEASE_ARM64_T6000 arm64

$ deno run -Ar --unstable examples/server.ts
Listening on http://localhost:8080/

The webview window shows a blank screen. Furthermore the server is unresponsive:

$ curl http://localhost:8080/
<hangs>
@svilupp
Copy link

svilupp commented Nov 1, 2024

Same here! It would be awesome to sort out to build and serve mini Vue apps.

@svefro
Copy link

svefro commented Nov 7, 2024

same here on windows

@loukamb
Copy link

loukamb commented Nov 12, 2024

Same here on Linux. I am currently using WebUI as an alternative, which isn't ideal for my purposes but works.

@eliassjogreen eliassjogreen added bug Something isn't working duplicate This issue or pull request already exists macos Related to macOS labels Nov 13, 2024
@eliassjogreen
Copy link
Member

eliassjogreen commented Nov 13, 2024

This is most likely due to #149 (comment) and has been an issue for a while. Could also be because the webview run method is blocking on the main thread (never allowing the JS event loop to step), and therefor a potential server needs to be run on a separate worker (thread).

@svilupp
Copy link

svilupp commented Nov 13, 2024

That's a helpful pointer! Would you perhaps have an example of how to run the server on a worker thread to get it to work?

@loukamb
Copy link

loukamb commented Nov 13, 2024

This is most likely due to #149 (comment) and has been an issue for a while. Could also be because the webview run method is blocking on the main thread (never allowing the JS event loop to step), and therefor a potential server needs to be run on a separate worker (thread).

This wouldn't explain the problem existing on Windows or Linux platforms, since they're not bound by that requirement to have UI code on the main thread. I understand the issue's title relates to macOS specifically, however. Maybe a separate issue should be created for the other operating systems too?

As for having a worker, that would only be a hackfix for what is essentially a regression (in the case of Windows and Linux operating systems). webview_deno used to work in the past without having to run anything in a worker. The library should be updated to include this boilerplate worker code if it's inevitable (so that existing projects consuming it won't have to significantly alter their codebase), or the underlying issue corrected if the use of a worker is actually unnecessary.

I'm of the opinion that a worker is unnecessary, and that Deno 2 (or maybe a newer version of the webview library?) simply introduced breaking changes, so the library should be updated accordingly.

@eliassjogreen
Copy link
Member

As for having a worker, that would only be a hackfix for what is essentially a regression (in the case of Windows and Linux operating systems). webview_deno used to work in the past without having to run anything in a worker. The library should be updated to include this boilerplate worker code if it's inevitable (so that existing projects consuming it won't have to significantly alter their codebase), or the underlying issue corrected if the use of a worker is actually unnecessary.

Agreed, but it is an issue with the underlying webview library: webview/webview#578

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working duplicate This issue or pull request already exists macos Related to macOS
Development

No branches or pull requests

5 participants